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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations