Search in sources :

Example 1 with ActionsProperty

use of org.csstudio.opibuilder.properties.ActionsProperty 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 2 with ActionsProperty

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

the class DisplayModel method configureProperties.

@Override
protected void configureProperties() {
    addProperty(new IntegerProperty(PROP_GRID_SPACE, "Grid Space", WidgetPropertyCategory.Display, 6, 1, 1000));
    addProperty(new BooleanProperty(PROP_SHOW_GRID, "Show Grid", WidgetPropertyCategory.Display, true));
    addProperty(new BooleanProperty(PROP_SHOW_RULER, "Show Ruler", WidgetPropertyCategory.Display, true));
    addProperty(new BooleanProperty(PROP_SNAP_GEOMETRY, "Snap to Geometry", WidgetPropertyCategory.Display, true));
    addProperty(new BooleanProperty(PROP_SHOW_EDIT_RANGE, "Show Edit Range", WidgetPropertyCategory.Display, true));
    addProperty(new BooleanProperty(PROP_AUTO_ZOOM_TO_FIT_ALL, "Auto Zoom to Fit All", WidgetPropertyCategory.Behavior, false));
    addProperty(new ComplexDataProperty(PROP_AUTO_SCALE_WIDGETS, "Auto Scale Widgets (at Runtime)", WidgetPropertyCategory.Behavior, new DisplayScaleData(this), "Scale Widgets as windows resizes"));
    addProperty(new BooleanProperty(PROP_SHOW_CLOSE_BUTTON, "Show Close Button", WidgetPropertyCategory.Display, true));
    Version version = new Version(0, 0, 0);
    addProperty(new VersionProperty(PROP_BOY_VERSION, "BOY Version", WidgetPropertyCategory.Basic, version.toString()));
    addProperty(new DoubleProperty(PROP_FRAME_RATE, "Frame Rate", WidgetPropertyCategory.Display, -1.0));
    setPropertyVisible(PROP_BORDER_COLOR, false);
    setPropertyVisible(PROP_BORDER_STYLE, false);
    setPropertyVisible(PROP_BORDER_WIDTH, false);
    setPropertyVisible(PROP_VISIBLE, false);
    setPropertyVisible(PROP_ENABLED, false);
    setPropertyVisible(PROP_TOOLTIP, false);
    setPropertyVisible(PROP_ACTIONS, false);
    setPropertyVisible(PROP_FONT, false);
    setPropertyVisibleAndSavable(PROP_FRAME_RATE, false, false);
    setPropertyVisibleAndSavable(PROP_BOY_VERSION, false, true);
    addProperty(new ActionsProperty(PROP_ACTIONS, "Actions", WidgetPropertyCategory.Behavior, false));
    setPropertyDescription(PROP_COLOR_FOREGROUND, "Grid Color");
    // $NON-NLS-1$
    setPropertyValue(PROP_NAME, "");
    removeProperty(PROP_SCALE_OPTIONS);
}
Also used : IntegerProperty(org.csstudio.opibuilder.properties.IntegerProperty) ComplexDataProperty(org.csstudio.opibuilder.properties.ComplexDataProperty) Version(org.osgi.framework.Version) BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty) ActionsProperty(org.csstudio.opibuilder.properties.ActionsProperty) VersionProperty(org.csstudio.opibuilder.properties.VersionProperty) DoubleProperty(org.csstudio.opibuilder.properties.DoubleProperty) DisplayScaleData(org.csstudio.opibuilder.datadefinition.DisplayScaleData)

Example 3 with ActionsProperty

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

the class MenuButtonModel method configureProperties.

/**
 * {@inheritDoc}
 */
@Override
protected void configureProperties() {
    addProperty(new StringProperty(PROP_LABEL, "Label", WidgetPropertyCategory.Display, // $NON-NLS-1$
    ""));
    addProperty(new BooleanProperty(PROP_ACTIONS_FROM_PV, "Actions From PV", WidgetPropertyCategory.Behavior, DEFAULT_ACTIONS_FROM_PV));
    addProperty(new BooleanProperty(PROP_TRANSPARENT, "Transparent", WidgetPropertyCategory.Display, false));
    addProperty(new BooleanProperty(PROP_SHOW_DOWN_ARROW, "Show Down Arrow", WidgetPropertyCategory.Display, false));
    removeProperty(PROP_ACTIONS);
    addProperty(new ActionsProperty(PROP_ACTIONS, "Actions", WidgetPropertyCategory.Behavior, false));
    setPropertyVisible(PROP_ACTIONS, !DEFAULT_ACTIONS_FROM_PV);
}
Also used : BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty) ActionsProperty(org.csstudio.opibuilder.properties.ActionsProperty) StringProperty(org.csstudio.opibuilder.properties.StringProperty)

Example 4 with ActionsProperty

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

the class ActionButtonModel method configureProperties.

/**
 * {@inheritDoc}
 */
@Override
protected void configureProperties() {
    addProperty(new ComboProperty(PROP_STYLE, "Style", WidgetPropertyCategory.Basic, Style.stringValues(), getDefaultStyle().ordinal()));
    addProperty(new StringProperty(PROP_TEXT, "Text", WidgetPropertyCategory.Display, "$(actions)", // $NON-NLS-1$
    true));
    addProperty(new IntegerProperty(PROP_ACTION_INDEX, "Click Action Index", WidgetPropertyCategory.Behavior, 0, -1, Integer.MAX_VALUE));
    addProperty(new IntegerProperty(PROP_RELEASED_ACTION_INDEX, "Release Action Index", WidgetPropertyCategory.Behavior, 0, -1, Integer.MAX_VALUE));
    addProperty(new BooleanProperty(PROP_TOGGLE_BUTTON, "Toggle Button", WidgetPropertyCategory.Behavior, DEFAULT_TOGGLE_BUTTON));
    addProperty(new FilePathProperty(PROP_IMAGE, "Icon File", WidgetPropertyCategory.Display, new Path(""), // $NON-NLS-1$
    FILE_EXTENSIONS));
    removeProperty(PROP_ACTIONS);
    addProperty(new ActionsProperty(PROP_ACTIONS, "Actions", WidgetPropertyCategory.Behavior, false));
    setPropertyVisible(PROP_RELEASED_ACTION_INDEX, DEFAULT_TOGGLE_BUTTON);
}
Also used : ComboProperty(org.csstudio.opibuilder.properties.ComboProperty) IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) IntegerProperty(org.csstudio.opibuilder.properties.IntegerProperty) BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty) ActionsProperty(org.csstudio.opibuilder.properties.ActionsProperty) StringProperty(org.csstudio.opibuilder.properties.StringProperty) FilePathProperty(org.csstudio.opibuilder.properties.FilePathProperty)

Example 5 with ActionsProperty

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

the class BoolButtonModel method configureProperties.

@Override
protected void configureProperties() {
    super.configureProperties();
    addProperty(new BooleanProperty(PROP_EFFECT3D, "3D Effect", WidgetPropertyCategory.Display, true));
    addProperty(new BooleanProperty(PROP_SQUARE_BUTTON, "Square Button", WidgetPropertyCategory.Display, false));
    addProperty(new BooleanProperty(PROP_SHOW_LED, "Show LED", WidgetPropertyCategory.Display, true));
    addProperty(new BooleanProperty(PROP_LABELS_FROM_PV, "Labels From PV", WidgetPropertyCategory.Display, false));
    removeProperty(PROP_ACTIONS);
    addProperty(new ActionsProperty(PROP_ACTIONS, "Actions", WidgetPropertyCategory.Behavior, false));
    setPropertyVisible(PROP_BOOL_LABEL_POS, false);
}
Also used : BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty) ActionsProperty(org.csstudio.opibuilder.properties.ActionsProperty)

Aggregations

ActionsProperty (org.csstudio.opibuilder.properties.ActionsProperty)7 BooleanProperty (org.csstudio.opibuilder.properties.BooleanProperty)7 IntegerProperty (org.csstudio.opibuilder.properties.IntegerProperty)3 StringProperty (org.csstudio.opibuilder.properties.StringProperty)3 ComboProperty (org.csstudio.opibuilder.properties.ComboProperty)2 ComplexDataProperty (org.csstudio.opibuilder.properties.ComplexDataProperty)2 FilePathProperty (org.csstudio.opibuilder.properties.FilePathProperty)2 IPath (org.eclipse.core.runtime.IPath)2 Path (org.eclipse.core.runtime.Path)2 PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1 UID (java.rmi.server.UID)1 DisplayScaleData (org.csstudio.opibuilder.datadefinition.DisplayScaleData)1 WidgetScaleData (org.csstudio.opibuilder.datadefinition.WidgetScaleData)1 ColorProperty (org.csstudio.opibuilder.properties.ColorProperty)1 DoubleProperty (org.csstudio.opibuilder.properties.DoubleProperty)1 FontProperty (org.csstudio.opibuilder.properties.FontProperty)1 RulesProperty (org.csstudio.opibuilder.properties.RulesProperty)1 ScriptProperty (org.csstudio.opibuilder.properties.ScriptProperty)1 UnchangableStringProperty (org.csstudio.opibuilder.properties.UnchangableStringProperty)1