[brailleblaster] Create a new style

  • From: Hanxiao Fu <hxfu829@xxxxxxxxx>
  • To: BBlist <brailleblaster@xxxxxxxxxxxxx>
  • Date: Mon, 30 Jul 2012 21:56:49 +0800

Hi all,

As part of the editing and displaying function, users will be able to
create customized style in BB. I've made a simple example of "creating a
new style window" to demonstrate what I'm trying to implement into BB.
Please check out the two files in the attachment, and run to see if you
have any suggestions. Note that you will need to add swt in the build path
in order to compile this little demo. Here are something I'd like to
discuss with you guys.

1. If you run the program, you will find the "Create A New Style" button,
which open a new window, where there are bunch of labels and fields to be
filled for creating the new style. However, the "create" button doesn't
really do anything, but print out the input for now. I think, ideally, in
our algorithm, this should create a properties in user's local directory,
but it won't initiate an instance of Style until there is one line using
this style.

2. I mostly worry about the accessibility. The new style is created by
either filling out the fields or selecting from combos, but I am not sure
whether it is clear enough to show that which field every label corresponds
to. I am using tool tips on both labels and fields, but I'm not sure if it
would help. The layout uses form layout by the way.

3. Since we will be able to handle a lot of different kinds of documents, I
assume that there would be different properties for the styles for
different kinds of documents, so the properties, lines_before and etc, are
stored in an enum class, where each element in the class takes two
parameters, one indicates the type of the property, i.e. integer, boolean;
the other one is default value. The two parameters now are hardcoded, but
in the later work it can be extended to read from properties files, so that
it would be extensible enough to be adjusted for different kind of docs.

4. Validations. Now it only accepts numbers for these number-related
fields, but there's no limit on how big the number could be. Let me know if
you think there should be more constraints on the input.

5. I'm thinking about adding an menu item for creating new styles.
Currently I can only find the menu item called "select style". Maybe I can
somehow integrate these two features together, so both of them can be found
through, say, "style".

Please see if the little demo could work, especially about the
accessibility. Any suggestions/criticisms are welcome.

Thanks,
Hanxiao

Other related posts: