/** * Sets the color choiceSet from DE model. * * @param choiceSet The color ChoiceSet. */ public void setChoiceSet(IChoiceSet choiceSet) { this.choiceSet = choiceSet; String[] colors = ChoiceSetFactory.getDisplayNamefromChoiceSet(choiceSet); Arrays.sort(colors); combo.removeAll(); combo.add(NONE_CHOICE); if (colors != null) for (int i = 0; i < colors.length; i++) combo.add(colors[i]); }
/* * (non-Javadoc) * * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors() */ protected void createFieldEditors() { // super.createFieldEditors( ); lineHeight = new ComboBoxMeasureFieldEditor( StyleHandle.LINE_HEIGHT_PROP, Messages.getString( ((StyleHandle) model) .getPropertyHandle(StyleHandle.LINE_HEIGHT_PROP) .getDefn() .getDisplayNameID()), getChoiceArray( ChoiceSetFactory.getElementChoiceSet( ReportDesignConstants.STYLE_ELEMENT, StyleHandle.LINE_HEIGHT_PROP)), getChoiceArray( ChoiceSetFactory.getDimensionChoiceSet( ReportDesignConstants.STYLE_ELEMENT, StyleHandle.LINE_HEIGHT_PROP)), getFieldEditorParent()); lineHeight.setDefaultUnit( ((StyleHandle) model).getPropertyHandle(StyleHandle.LINE_HEIGHT_PROP).getDefaultUnit()); charSpacing = new ComboBoxMeasureFieldEditor( StyleHandle.LETTER_SPACING_PROP, Messages.getString( ((StyleHandle) model) .getPropertyHandle(StyleHandle.LETTER_SPACING_PROP) .getDefn() .getDisplayNameID()), getChoiceArray( ChoiceSetFactory.getElementChoiceSet( ReportDesignConstants.STYLE_ELEMENT, StyleHandle.LETTER_SPACING_PROP)), getChoiceArray( ChoiceSetFactory.getDimensionChoiceSet( ReportDesignConstants.STYLE_ELEMENT, StyleHandle.LETTER_SPACING_PROP)), getFieldEditorParent()); charSpacing.setDefaultUnit( ((StyleHandle) model).getPropertyHandle(StyleHandle.LETTER_SPACING_PROP).getDefaultUnit()); wordSpacing = new ComboBoxMeasureFieldEditor( StyleHandle.WORD_SPACING_PROP, Messages.getString( ((StyleHandle) model) .getPropertyHandle(StyleHandle.WORD_SPACING_PROP) .getDefn() .getDisplayNameID()), getChoiceArray( ChoiceSetFactory.getElementChoiceSet( ReportDesignConstants.STYLE_ELEMENT, StyleHandle.WORD_SPACING_PROP)), getChoiceArray( ChoiceSetFactory.getDimensionChoiceSet( ReportDesignConstants.STYLE_ELEMENT, StyleHandle.WORD_SPACING_PROP)), getFieldEditorParent()); wordSpacing.setDefaultUnit( ((StyleHandle) model).getPropertyHandle(StyleHandle.WORD_SPACING_PROP).getDefaultUnit()); verticalAlign = new ComboBoxFieldEditor( StyleHandle.VERTICAL_ALIGN_PROP, Messages.getString( ((StyleHandle) model) .getPropertyHandle(StyleHandle.VERTICAL_ALIGN_PROP) .getDefn() .getDisplayNameID()), getChoiceArray( ChoiceSetFactory.getElementChoiceSet( ReportDesignConstants.STYLE_ELEMENT, StyleHandle.VERTICAL_ALIGN_PROP), true), getFieldEditorParent()); textAlign = new ComboBoxFieldEditor( StyleHandle.TEXT_ALIGN_PROP, Messages.getString( ((StyleHandle) model) .getPropertyHandle(StyleHandle.TEXT_ALIGN_PROP) .getDefn() .getDisplayNameID()), getChoiceArray( ChoiceSetFactory.getElementChoiceSet( ReportDesignConstants.STYLE_ELEMENT, StyleHandle.TEXT_ALIGN_PROP), true), getFieldEditorParent()); textIndent = new ComboBoxMeasureFieldEditor( StyleHandle.TEXT_INDENT_PROP, Messages.getString( ((StyleHandle) model) .getPropertyHandle(StyleHandle.TEXT_INDENT_PROP) .getDefn() .getDisplayNameID()), getChoiceArray( ChoiceSetFactory.getDimensionChoiceSet( ReportDesignConstants.STYLE_ELEMENT, StyleHandle.TEXT_INDENT_PROP)), getFieldEditorParent()); textIndent.setDefaultUnit( ((StyleHandle) model).getPropertyHandle(StyleHandle.TEXT_INDENT_PROP).getDefaultUnit()); textTrans = new ComboBoxFieldEditor( StyleHandle.TEXT_TRANSFORM_PROP, Messages.getString( ((StyleHandle) model) .getPropertyHandle(StyleHandle.TEXT_TRANSFORM_PROP) .getDefn() .getDisplayNameID()), getChoiceArray( ChoiceSetFactory.getElementChoiceSet( ReportDesignConstants.STYLE_ELEMENT, StyleHandle.TEXT_TRANSFORM_PROP)), getFieldEditorParent()); whiteSpace = new ComboBoxFieldEditor( StyleHandle.WHITE_SPACE_PROP, Messages.getString( ((StyleHandle) model) .getPropertyHandle(StyleHandle.WHITE_SPACE_PROP) .getDefn() .getDisplayNameID()), getChoiceArray( ChoiceSetFactory.getElementChoiceSet( ReportDesignConstants.STYLE_ELEMENT, StyleHandle.WHITE_SPACE_PROP)), getFieldEditorParent()); display = new ComboBoxFieldEditor( StyleHandle.DISPLAY_PROP, Messages.getString( ((StyleHandle) model) .getPropertyHandle(StyleHandle.DISPLAY_PROP) .getDefn() .getDisplayNameID()), getChoiceArray( ChoiceSetFactory.getElementChoiceSet( ReportDesignConstants.STYLE_ELEMENT, StyleHandle.DISPLAY_PROP)), getFieldEditorParent()); addField(lineHeight); addField(charSpacing); addField(wordSpacing); addField(verticalAlign); addField(textAlign); addField(textIndent); addField(textTrans); addField(whiteSpace); addField(display); // bidi_hcg start direction = new ComboBoxFieldEditor( StyleHandle.TEXT_DIRECTION_PROP, Messages.getString( ((StyleHandle) model) .getPropertyHandle(StyleHandle.TEXT_DIRECTION_PROP) .getDefn() .getDisplayNameID()), getChoiceArray( ChoiceSetFactory.getElementChoiceSet( ReportDesignConstants.STYLE_ELEMENT, StyleHandle.TEXT_DIRECTION_PROP), true), getFieldEditorParent()); addField(direction); // bidi_hcg end UIUtil.bindHelp(getFieldEditorParent().getParent(), IHelpContextIds.STYLE_BUILDER_TEXTBLOCK_ID); }