Search in sources :

Example 6 with Button

use of org.eclipse.swt.widgets.Button in project cogtool by cogtool.

the class ActionChangePropertySet method createMouseComposite.

@Override
protected Composite createMouseComposite() {
    Composite c = super.createMouseComposite();
    mouseChoice = new Button(actionComposite, SWT.RADIO);
    mouseChoice.setData(new Integer(ActionSet.USE_MOUSE));
    mouseChoice.addSelectionListener(getActionChoiceListener());
    mouseChoice.setText(MOUSE_LABEL);
    c.setData(mouseChoice);
    if (actionSettingsLayout.topControl == null) {
        setSelectedActionChoice(mouseChoice, c, mouseButtonCombo);
    }
    return c;
}
Also used : Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button)

Example 7 with Button

use of org.eclipse.swt.widgets.Button in project cogtool by cogtool.

the class ActionChangePropertySet method createVoiceComposite.

@Override
protected Composite createVoiceComposite() {
    Composite c = super.createVoiceComposite();
    voiceChoice = new Button(actionComposite, SWT.RADIO);
    voiceChoice.setData(new Integer(ActionSet.USE_VOICE));
    voiceChoice.addSelectionListener(getActionChoiceListener());
    voiceChoice.setText(VOICE_LABEL);
    c.setData(voiceChoice);
    if (actionSettingsLayout.topControl == null) {
        setSelectedActionChoice(voiceChoice, c, voiceText);
    }
    return c;
}
Also used : Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button)

Example 8 with Button

use of org.eclipse.swt.widgets.Button 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;
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Point(org.eclipse.swt.graphics.Point) DisplayLabel(edu.cmu.cs.hcii.cogtool.util.DisplayLabel) Design(edu.cmu.cs.hcii.cogtool.model.Design) DesignEditorUI(edu.cmu.cs.hcii.cogtool.ui.DesignEditorUI) Button(org.eclipse.swt.widgets.Button) ListenerIdentifierMap(edu.cmu.cs.hcii.cogtool.util.ListenerIdentifierMap) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Tree(org.eclipse.swt.widgets.Tree) ComboWithEnableFix(edu.cmu.cs.hcii.cogtool.util.ComboWithEnableFix)

Example 9 with Button

use of org.eclipse.swt.widgets.Button in project cogtool by cogtool.

the class ActionPropertySet method createRestoreDefaultsButton.

protected Button createRestoreDefaultsButton(Composite parentComposite) {
    Button restoreDefaults = new Button(parentComposite, SWT.PUSH);
    restoreDefaults.setText(restoreDefaultsLabel);
    return restoreDefaults;
}
Also used : Button(org.eclipse.swt.widgets.Button)

Example 10 with Button

use of org.eclipse.swt.widgets.Button in project cogtool by cogtool.

the class ActionSet method createVoiceComposite.

protected Composite createVoiceComposite() {
    Composite voiceComp = new Composite(actionSettings, SWT.NONE);
    voiceComp.setLayout(new FormLayout());
    voiceTextLabel = new DisplayLabel(voiceComp, SWT.NONE);
    voiceTextLabel.setText(L10N.get("DE.VoiceTextCaption", "Spoken Input") + ":");
    // TODO Why is this here rather than in its natural home in the
    //      overridden method in ActionPropertySet?
    transitionDestinationLabelVoice = createTransitionDestinationLabel(voiceComp);
    transitionDestinationNameVoice = createTransitionDestinationName(voiceComp);
    voiceText = createVoiceText(voiceComp);
    voiceIsCmd = new Button(voiceComp, SWT.CHECK);
    voiceIsCmd.setText(L10N.get("DE.IsCommand", "Is Command"));
    voiceIsCmd.addSelectionListener(deviceActionChange);
    return voiceComp;
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) DisplayLabel(edu.cmu.cs.hcii.cogtool.util.DisplayLabel)

Aggregations

Button (org.eclipse.swt.widgets.Button)3370 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1988 GridData (org.eclipse.swt.layout.GridData)1806 Composite (org.eclipse.swt.widgets.Composite)1782 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1651 GridLayout (org.eclipse.swt.layout.GridLayout)1580 Label (org.eclipse.swt.widgets.Label)1570 Text (org.eclipse.swt.widgets.Text)1100 Group (org.eclipse.swt.widgets.Group)806 ModifyListener (org.eclipse.swt.events.ModifyListener)618 ModifyEvent (org.eclipse.swt.events.ModifyEvent)606 FormAttachment (org.eclipse.swt.layout.FormAttachment)556 FormData (org.eclipse.swt.layout.FormData)556 Shell (org.eclipse.swt.widgets.Shell)524 FormLayout (org.eclipse.swt.layout.FormLayout)499 Event (org.eclipse.swt.widgets.Event)499 SelectionListener (org.eclipse.swt.events.SelectionListener)492 Listener (org.eclipse.swt.widgets.Listener)474 Display (org.eclipse.swt.widgets.Display)424 ShellEvent (org.eclipse.swt.events.ShellEvent)350