use of edu.cmu.cs.hcii.cogtool.util.ListenerIdentifierMap in project cogtool by cogtool.
the class ActionPropertySet method createEmptyComposite.
protected Composite createEmptyComposite() {
Composite c = new Composite(actionSettings, SWT.NONE);
c.setLayout(new FormLayout());
ListenerIdentifierMap lidMap = view.getLIDMap();
designNameLabel = new DisplayLabel(c, SWT.NONE);
designNameLabel.setText(nameLabel);
designName = new View.PerformActionText(c, SWT.SINGLE | SWT.BORDER) {
@Override
protected void onFocus() {
super.onFocus();
view.getTransmuter().setLIDEnabledState();
}
@Override
protected boolean doChangeAction() {
Design design = (Design) designName.getData();
DesignEditorUI.DesignRenameParameters parms = new DesignEditorUI.DesignRenameParameters(design, designName.getText());
boolean changed = view.performAction(ProjectLID.RenameDesign, parms, true);
if (!changed) {
designName.setText(design.getName());
}
return changed;
}
};
inputDevicesLabel = new DisplayLabel(c, SWT.NONE);
inputDevicesLabel.setText(L10N.get("APS.InputDevices", "Input Devices") + ":");
outputDevicesLabel = new DisplayLabel(c, SWT.NONE);
outputDevicesLabel.setText(L10N.get("APS.OutputDevices", "Output Devices") + ":");
for (int i = 0; i < DeviceType.DISPLAY_ORDER.length; i++) {
deviceButtons[i] = new Button(c, SWT.CHECK);
deviceButtons[i].setText(DeviceType.DISPLAY_ORDER[i].getName());
deviceButtons[i].setEnabled(false);
deviceButtons[i].setSelection(false);
}
addDevices = new Button(c, SWT.PUSH);
addDevices.setText(addDevicesLabel);
addDevices.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
view.performAction(DesignEditorLID.AddDesignDevices);
}
});
lidMap.addWidget(DesignEditorLID.AddDesignDevices, addDevices, ListenerIdentifierMap.NORMAL);
skinLabel = new DisplayLabel(c, SWT.NONE);
skinLabel.setText(DESIGN_SKIN);
skinCombo = new ComboWithEnableFix(c, SWT.DROP_DOWN | SWT.READ_ONLY);
for (int i = 1; i < SkinType.DISPLAY.length - 1; i++) {
// Don't allow None or Palm
skinCombo.add(SkinType.DISPLAY[i].getName());
}
skinCombo.select(0);
skinCombo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
switch(skinCombo.getSelectionIndex()) {
case 0:
default:
{
view.performAction(DesignEditorLID.SkinWireFrame);
break;
}
case 1:
{
view.performAction(DesignEditorLID.SkinMacOSX);
break;
}
case 2:
{
view.performAction(DesignEditorLID.SkinWinXP);
break;
}
}
}
});
frameTreeLabel = new DisplayLabel(c, SWT.NONE);
frameTreeLabel.setText(FRAMES);
frameTree = new Tree(c, SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
frameTree.setLinesVisible(true);
updater = new TreeItemUpdater.FrameItemUpdater(frameTree);
return c;
}
use of edu.cmu.cs.hcii.cogtool.util.ListenerIdentifierMap in project cogtool by cogtool.
the class FramePropertiesPane method createWidgets.
protected void createWidgets(final View view) {
ListenerIdentifierMap lidMap = view.getLIDMap();
frameNameLabel = new DisplayLabel(this, SWT.NONE);
frameNameLabel.setText(NAME_LABEL);
frameName = new View.PerformActionText(this, SWT.SINGLE | SWT.BORDER) {
@Override
protected void onFocus() {
super.onFocus();
view.getTransmuter().setLIDEnabledState();
}
@Override
protected boolean doChangeAction() {
Frame frame = (Frame) getData();
DesignEditorUI.FrameRenameParameters evt = new DesignEditorUI.FrameRenameParameters(frame, getText());
boolean changed = view.performAction(DesignEditorLID.RenameFrame, evt, true);
if (!changed) {
setText(frame.getName());
}
return changed;
}
};
imagePath = new DisplayLabel(this, SWT.NONE);
imagePath.setText(IMAGE_PATH);
imagePathText = new TextWithEnableFix(this, SWT.SINGLE | SWT.READ_ONLY);
widgetTreeLabel = new DisplayLabel(this, SWT.NONE);
widgetTreeLabel.setText(WIDGETS);
widgetTree = new Tree(this, SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
widgetTree.setLinesVisible(true);
widgetUpdater = new TreeItemUpdater.WidgetItemUpdater(widgetTree);
if (CogToolPref.RESEARCH.getBoolean()) {
eltGroupTreeLabel = new DisplayLabel(this, SWT.NONE);
eltGroupTreeLabel.setText(ELEMENT_GROUPS);
eltGroupTree = new Tree(this, SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
eltGroupTree.setLinesVisible(true);
eltGroupUpdater = new TreeItemUpdater.EltGroupItemUpdater(eltGroupTree);
implicitGroupTreeLabel = new DisplayLabel(this, SWT.NONE);
implicitGroupTreeLabel.setText(IMPLICIT_GROUPS);
implicitGroupTree = new Tree(this, SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER);
implicitGroupTree.setLinesVisible(true);
implicitGroupUpdater = new TreeItemUpdater.ImplicitGroupItemUpdater(implicitGroupTree);
}
}
Aggregations