Search in sources :

Example 1 with ComboProperty

use of org.csstudio.opibuilder.properties.ComboProperty in project yamcs-studio by yamcs.

the class OpenDisplayAction method configureProperties.

@Override
protected void configureProperties() {
    addProperty(new FilePathProperty(PROP_PATH, "File Path", WidgetPropertyCategory.Basic, new Path(""), new String[] { "opi" }, false) {

        @Override
        public Object readValueFromXML(Element propElement) {
            handleLegacySettings(propElement);
            return super.readValueFromXML(propElement);
        }
    });
    addProperty(new MacrosProperty(PROP_MACROS, "Macros", WidgetPropertyCategory.Basic, new MacrosInput(new LinkedHashMap<String, String>(), true)));
    addProperty(new ComboProperty(PROP_MODE, "Mode", WidgetPropertyCategory.Basic, DisplayMode.stringValues(), DisplayMode.REPLACE.ordinal()));
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) MacrosInput(org.csstudio.opibuilder.util.MacrosInput) ComboProperty(org.csstudio.opibuilder.properties.ComboProperty) Element(org.jdom.Element) FilePathProperty(org.csstudio.opibuilder.properties.FilePathProperty) MacrosProperty(org.csstudio.opibuilder.properties.MacrosProperty)

Example 2 with ComboProperty

use of org.csstudio.opibuilder.properties.ComboProperty in project yamcs-studio by yamcs.

the class AbstractWidgetModel method configureBaseProperties.

protected void configureBaseProperties() {
    addProperty(new IntegerProperty(PROP_WIDTH, "Width", WidgetPropertyCategory.Position, 100, 1, 10000));
    addProperty(new IntegerProperty(PROP_HEIGHT, "Height", WidgetPropertyCategory.Position, 100, 1, 10000));
    addProperty(new IntegerProperty(PROP_XPOS, "X", WidgetPropertyCategory.Position, 0));
    addProperty(new IntegerProperty(PROP_YPOS, "Y", WidgetPropertyCategory.Position, 0));
    addProperty(new ColorProperty(PROP_COLOR_BACKGROUND, "Background Color", WidgetPropertyCategory.Display, new RGB(240, 240, 240)));
    addProperty(new ColorProperty(PROP_COLOR_FOREGROUND, "Foreground Color", WidgetPropertyCategory.Display, new RGB(192, 192, 192)));
    addProperty(new FontProperty(PROP_FONT, "Font", WidgetPropertyCategory.Display, MediaService.DEFAULT_FONT));
    addProperty(new ColorProperty(PROP_BORDER_COLOR, "Border Color", WidgetPropertyCategory.Border, new RGB(0, 128, 255)));
    addProperty(new ComboProperty(PROP_BORDER_STYLE, "Border Style", WidgetPropertyCategory.Border, BorderStyle.stringValues(), 0));
    addProperty(new IntegerProperty(PROP_BORDER_WIDTH, "Border Width", WidgetPropertyCategory.Border, 1, 0, 1000));
    addProperty(new BooleanProperty(PROP_ENABLED, "Enabled", WidgetPropertyCategory.Behavior, true));
    addProperty(new BooleanProperty(PROP_VISIBLE, "Visible", WidgetPropertyCategory.Behavior, true));
    addProperty(new ScriptProperty(PROP_SCRIPTS, "Scripts", WidgetPropertyCategory.Behavior));
    addProperty(new ActionsProperty(PROP_ACTIONS, "Actions", WidgetPropertyCategory.Behavior));
    addProperty(new StringProperty(PROP_TOOLTIP, "Tooltip", WidgetPropertyCategory.Display, "", true));
    addProperty(new RulesProperty(PROP_RULES, "Rules", WidgetPropertyCategory.Behavior));
    addProperty(new ComplexDataProperty(PROP_SCALE_OPTIONS, "Scale Options", WidgetPropertyCategory.Position, new WidgetScaleData(this, true, true, false), "Set Scale Options"));
    addProperty(new StringProperty(PROP_WIDGET_UID, "Widget UID", WidgetPropertyCategory.Basic, new UID().toString()));
    // update the WUID saved in connections without triggering anything
    getProperty(PROP_WIDGET_UID).addPropertyChangeListener(new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            for (ConnectionModel connection : sourceConnections) {
                connection.setPropertyValue(ConnectionModel.PROP_SRC_WUID, evt.getNewValue(), false);
            }
            for (ConnectionModel connection : targetConnections) {
                connection.setPropertyValue(ConnectionModel.PROP_TGT_WUID, evt.getNewValue(), false);
            }
        }
    });
    setPropertyVisibleAndSavable(PROP_WIDGET_UID, false, true);
    WidgetDescriptor descriptor = WidgetsService.getInstance().getWidgetDescriptor(getTypeID());
    String name;
    name = descriptor == null ? getTypeID().substring(getTypeID().lastIndexOf(".") + 1) : descriptor.getName();
    addProperty(new StringProperty(PROP_NAME, "Name", WidgetPropertyCategory.Basic, name));
    addProperty(new UnchangableStringProperty(PROP_WIDGET_TYPE, "Widget Type", WidgetPropertyCategory.Basic, name));
    addProperty(new UnsavableListProperty(PROP_SRC_CONNECTIONS, "Source Connections", WidgetPropertyCategory.Display, sourceConnections));
    setPropertyVisible(PROP_SRC_CONNECTIONS, false);
    addProperty(new UnsavableListProperty(PROP_TGT_CONNECTIONS, "Target Connections", WidgetPropertyCategory.Display, targetConnections));
    setPropertyVisible(PROP_TGT_CONNECTIONS, false);
}
Also used : ComboProperty(org.csstudio.opibuilder.properties.ComboProperty) IntegerProperty(org.csstudio.opibuilder.properties.IntegerProperty) ComplexDataProperty(org.csstudio.opibuilder.properties.ComplexDataProperty) PropertyChangeEvent(java.beans.PropertyChangeEvent) PropertyChangeListener(java.beans.PropertyChangeListener) BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty) ActionsProperty(org.csstudio.opibuilder.properties.ActionsProperty) UnchangableStringProperty(org.csstudio.opibuilder.properties.UnchangableStringProperty) ScriptProperty(org.csstudio.opibuilder.properties.ScriptProperty) StringProperty(org.csstudio.opibuilder.properties.StringProperty) UnchangableStringProperty(org.csstudio.opibuilder.properties.UnchangableStringProperty) WidgetDescriptor(org.csstudio.opibuilder.util.WidgetDescriptor) RGB(org.eclipse.swt.graphics.RGB) RulesProperty(org.csstudio.opibuilder.properties.RulesProperty) FontProperty(org.csstudio.opibuilder.properties.FontProperty) UID(java.rmi.server.UID) UnsavableListProperty(org.csstudio.opibuilder.properties.UnsavableListProperty) ColorProperty(org.csstudio.opibuilder.properties.ColorProperty) WidgetScaleData(org.csstudio.opibuilder.datadefinition.WidgetScaleData)

Example 3 with ComboProperty

use of org.csstudio.opibuilder.properties.ComboProperty in project yamcs-studio by yamcs.

the class AbstractBoolControlModel method configureProperties.

@Override
protected void configureProperties() {
    super.configureProperties();
    addProperty(new BooleanProperty(PROP_TOGGLE_BUTTON, "Toggle Button", WidgetPropertyCategory.Behavior, DEFAULT_TOGGLE_BUTTON));
    addProperty(new ComboProperty(PROP_CONFIRM_DIALOG, "Show Confirm Dialog", WidgetPropertyCategory.Behavior, ShowConfirmDialog.stringValues(), 0));
    addProperty(new StringProperty(PROP_PASSWORD, "Password", WidgetPropertyCategory.Behavior, ""));
    addProperty(new StringProperty(PROP_CONFIRM_TIP, "Confirm Message", WidgetPropertyCategory.Behavior, DEFAULT_CONFIRM_TIP));
    addProperty(new IntegerProperty(PROP_PUSH_ACTION_INDEX, "Push Action Index", WidgetPropertyCategory.Behavior, 0, 0, Integer.MAX_VALUE));
    addProperty(new IntegerProperty(PROP_RELEASED_ACTION_INDEX, "Release Action Index", WidgetPropertyCategory.Behavior, 0, 0, Integer.MAX_VALUE));
}
Also used : ComboProperty(org.csstudio.opibuilder.properties.ComboProperty) IntegerProperty(org.csstudio.opibuilder.properties.IntegerProperty) BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty) StringProperty(org.csstudio.opibuilder.properties.StringProperty)

Example 4 with ComboProperty

use of org.csstudio.opibuilder.properties.ComboProperty in project yamcs-studio by yamcs.

the class ArrayModel method configureProperties.

@Override
protected void configureProperties() {
    addProperty(new IntegerProperty(PROP_ARRAY_LENGTH, "Array Length", WidgetPropertyCategory.Behavior, 10, 0, Integer.MAX_VALUE));
    addProperty(new IntegerProperty(PROP_SPINNER_WIDTH, "Spinner Width", WidgetPropertyCategory.Display, 40, 0, 1000));
    addProperty(new BooleanProperty(PROP_HORIZONTAL, "Horizontal", WidgetPropertyCategory.Display, false));
    addProperty(new BooleanProperty(PROP_SHOW_SPINNER, "Show Spinner", WidgetPropertyCategory.Display, true));
    addProperty(new BooleanProperty(PROP_SHOW_SCROLLBAR, "Show Scrollbar", WidgetPropertyCategory.Display, true));
    addProperty(new IntegerProperty(PROP_VISIBLE_ELEMENTS_COUNT, "Visible Elements Count", WidgetPropertyCategory.Display, 1, 0, 1000));
    addProperty(new ComboProperty(PROP_DATA_TYPE, "Data Type", WidgetPropertyCategory.Behavior, ArrayDataType.stringValues(), 0));
    setPropertyVisibleAndSavable(PROP_VISIBLE_ELEMENTS_COUNT, false, true);
    getProperty(PROP_VISIBLE_ELEMENTS_COUNT).addPropertyChangeListener(new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            if (getChildren().size() < 1)
                return;
            AbstractWidgetModel child = getChildren().get(0);
            removeAllChildren();
            addChild(child);
        }
    });
}
Also used : ComboProperty(org.csstudio.opibuilder.properties.ComboProperty) IntegerProperty(org.csstudio.opibuilder.properties.IntegerProperty) PropertyChangeEvent(java.beans.PropertyChangeEvent) AbstractWidgetModel(org.csstudio.opibuilder.model.AbstractWidgetModel) PropertyChangeListener(java.beans.PropertyChangeListener) BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty)

Example 5 with ComboProperty

use of org.csstudio.opibuilder.properties.ComboProperty in project yamcs-studio by yamcs.

the class LabelModel method configureProperties.

@Override
protected void configureProperties() {
    addProperty(new StringProperty(PROP_TEXT, "Text", WidgetPropertyCategory.Display, "Label", true));
    addProperty(new BooleanProperty(PROP_TRANSPARENT, "Transparent", WidgetPropertyCategory.Display, !pvModel));
    addProperty(new BooleanProperty(PROP_AUTOSIZE, "Auto Size", WidgetPropertyCategory.Display, false));
    addProperty(new ComboProperty(PROP_ALIGN_H, "Horizontal Alignment", WidgetPropertyCategory.Display, H_ALIGN.stringValues(), 1));
    addProperty(new ComboProperty(PROP_ALIGN_V, "Vertical Alignment", WidgetPropertyCategory.Display, V_ALIGN.stringValues(), 1));
    addProperty(new BooleanProperty(PROP_WRAP_WORDS, "Wrap Words", WidgetPropertyCategory.Behavior, false));
    addProperty(new BooleanProperty(PROP_SHOW_SCROLLBAR, "Show Scrollbar", WidgetPropertyCategory.Behavior, false));
    if (!pvModel) {
        setTooltip("");
        setPropertyVisible(PROP_PVNAME, false);
        setPropertyVisible(PROP_PVVALUE, false);
        setPropertyVisible(PROP_BACKCOLOR_ALARMSENSITIVE, false);
        setPropertyVisible(PROP_BORDER_ALARMSENSITIVE, false);
        setPropertyVisible(PROP_FORECOLOR_ALARMSENSITIVE, false);
        setPropertyVisible(PROP_ALARM_PULSING, false);
    }
}
Also used : ComboProperty(org.csstudio.opibuilder.properties.ComboProperty) BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty) StringProperty(org.csstudio.opibuilder.properties.StringProperty)

Aggregations

ComboProperty (org.csstudio.opibuilder.properties.ComboProperty)20 BooleanProperty (org.csstudio.opibuilder.properties.BooleanProperty)19 IntegerProperty (org.csstudio.opibuilder.properties.IntegerProperty)14 StringProperty (org.csstudio.opibuilder.properties.StringProperty)8 ColorProperty (org.csstudio.opibuilder.properties.ColorProperty)7 DoubleProperty (org.csstudio.opibuilder.properties.DoubleProperty)6 PropertyChangeEvent (java.beans.PropertyChangeEvent)3 PropertyChangeListener (java.beans.PropertyChangeListener)3 FilePathProperty (org.csstudio.opibuilder.properties.FilePathProperty)3 WidgetPropertyCategory (org.csstudio.opibuilder.properties.WidgetPropertyCategory)3 IPath (org.eclipse.core.runtime.IPath)3 Path (org.eclipse.core.runtime.Path)3 ActionsProperty (org.csstudio.opibuilder.properties.ActionsProperty)2 PVNameProperty (org.csstudio.opibuilder.properties.PVNameProperty)2 PVValueProperty (org.csstudio.opibuilder.properties.PVValueProperty)2 RGB (org.eclipse.swt.graphics.RGB)2 UID (java.rmi.server.UID)1 List (java.util.List)1 WidgetScaleData (org.csstudio.opibuilder.datadefinition.WidgetScaleData)1 AbstractWidgetModel (org.csstudio.opibuilder.model.AbstractWidgetModel)1