private void createOptionalDependenciesButton(Composite container) { if (isEditable()) { fIncludeOptionalButton = new Button(container, SWT.CHECK); fIncludeOptionalButton.setText(PDEUIMessages.PluginSection_includeOptional); // initialize value IEditorInput input = getPage().getEditorInput(); if (input instanceof IFileEditorInput) { IFile file = ((IFileEditorInput) input).getFile(); try { fIncludeOptionalButton.setSelection( "true".equals(file.getPersistentProperty(OPTIONAL_PROPERTY))); // $NON-NLS-1$ } catch (CoreException e) { } } // create listener to save value when the checkbox is changed fIncludeOptionalButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { IEditorInput input = getPage().getEditorInput(); if (input instanceof IFileEditorInput) { IFile file = ((IFileEditorInput) input).getFile(); try { file.setPersistentProperty( OPTIONAL_PROPERTY, fIncludeOptionalButton.getSelection() ? "true" : null); // $NON-NLS-1$ } catch (CoreException e1) { } } } }); } }
public JavaScriptSupportGroup(Composite composite, WizardPage projectWizardFirstPage) { final int numColumns = 3; fGroup = new Group(composite, SWT.NONE); fGroup.setFont(composite.getFont()); fGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fGroup.setLayout(initGridLayout(new GridLayout(numColumns, false), true)); fGroup.setText(PHPUIMessages.JavaScriptSupportGroup_OptionBlockTitle); // $NON-NLS-1$ fEnableJavaScriptSupport = new Button(fGroup, SWT.CHECK | SWT.RIGHT); fEnableJavaScriptSupport.setText( PHPUIMessages.JavaScriptSupportGroup_EnableSupport); // $NON-NLS-1$ fEnableJavaScriptSupport.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false)); fEnableJavaScriptSupport.addSelectionListener(this); fEnableJavaScriptSupport.setSelection( PHPUiPlugin.getDefault() .getPreferenceStore() .getBoolean((PreferenceConstants.JavaScriptSupportEnable))); }
private void createButtonStyleGroup(final Composite parent) { Group group = new Group(parent, SWT.NONE); group.setLayout(new GridLayout()); GridData layoutData = new GridData(SWT.FILL, SWT.FILL, false, false); group.setLayoutData(layoutData); group.setText("SWT MessageBox Styles"); okButton = new Button(group, SWT.CHECK); okButton.setText("SWT.OK"); cancelButton = new Button(group, SWT.CHECK); cancelButton.setText("SWT.CANCEL"); yesButton = new Button(group, SWT.CHECK); yesButton.setText("SWT.YES"); noButton = new Button(group, SWT.CHECK); noButton.setText("SWT.NO"); retryButton = new Button(group, SWT.CHECK); retryButton.setText("SWT.RETRY"); abortButton = new Button(group, SWT.CHECK); abortButton.setText("SWT.ABORT"); ignoreButton = new Button(group, SWT.CHECK); ignoreButton.setText("SWT.IGNORE"); }
private void createIconStyleGroup(final Composite parent) { Group group = new Group(parent, SWT.NONE); group.setLayout(new GridLayout()); GridData iconGroupData = new GridData(SWT.FILL, SWT.FILL, false, false); group.setLayoutData(iconGroupData); group.setText("SWT MessageBox Icon Styles"); iconErrorButton = new Button(group, SWT.RADIO); iconErrorButton.setText("SWT.ICON_ERROR"); iconInformationButton = new Button(group, SWT.RADIO); iconInformationButton.setText("SWT.ICON_INFORMATION"); iconQuestionButton = new Button(group, SWT.RADIO); iconQuestionButton.setText("SWT.ICON_QUESTION"); iconWarningButton = new Button(group, SWT.RADIO); iconWarningButton.setText("SWT.ICON_WARNING"); iconWorkingButton = new Button(group, SWT.RADIO); iconWorkingButton.setText("SWT.ICON_WORKING"); noIconButton = new Button(group, SWT.RADIO); noIconButton.setText("No Icon"); noIconButton.setSelection(true); }
private Composite createButtonArea(Composite parent) { ScrolledComposite comp = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL); GridLayout layout = new GridLayout(); layout.marginWidth = layout.marginHeight = 0; comp.setLayoutData(new GridData(GridData.FILL_VERTICAL)); Composite container = new Composite(comp, SWT.NONE); layout = new GridLayout(); layout.marginWidth = 0; container.setLayout(layout); GridData gd = new GridData(GridData.FILL_VERTICAL); gd.verticalIndent = 15; container.setLayoutData(gd); Button button = new Button(container, SWT.PUSH); button.setText(PDEUIMessages.ImportWizard_DetailedPage_existing); button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); button.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { handleExistingProjects(); } }); SWTUtil.setButtonDimensionHint(button); button = new Button(container, SWT.PUSH); button.setText(PDEUIMessages.ImportWizard_DetailedPage_existingUnshared); button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); button.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { handleExistingUnshared(); } }); SWTUtil.setButtonDimensionHint(button); fAddButton = new Button(container, SWT.PUSH); fAddButton.setText(PDEUIMessages.ImportWizard_DetailedPage_add); fAddButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fAddButton.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { handleAdd(); } }); SWTUtil.setButtonDimensionHint(fAddButton); fAddAllButton = new Button(container, SWT.PUSH); fAddAllButton.setText(PDEUIMessages.ImportWizard_DetailedPage_addAll); fAddAllButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fAddAllButton.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { handleAddAll(); } }); SWTUtil.setButtonDimensionHint(fAddAllButton); fRemoveButton = new Button(container, SWT.PUSH); fRemoveButton.setText(PDEUIMessages.ImportWizard_DetailedPage_remove); fRemoveButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fRemoveButton.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { handleRemove(); } }); SWTUtil.setButtonDimensionHint(fRemoveButton); fRemoveAllButton = new Button(container, SWT.PUSH); fRemoveAllButton.setText(PDEUIMessages.ImportWizard_DetailedPage_removeAll); fRemoveAllButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fRemoveAllButton.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { handleRemoveAll(); } }); SWTUtil.setButtonDimensionHint(fRemoveAllButton); button = new Button(container, SWT.PUSH); button.setText(PDEUIMessages.ImportWizard_DetailedPage_swap); button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); button.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { handleSwap(); } }); SWTUtil.setButtonDimensionHint(button); fAddRequiredButton = new Button(container, SWT.PUSH); fAddRequiredButton.setText(PDEUIMessages.ImportWizard_DetailedPage_addRequired); fAddRequiredButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); fAddRequiredButton.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { handleAddRequiredPlugins(); } }); SWTUtil.setButtonDimensionHint(fAddRequiredButton); fCountLabel = new Label(container, SWT.NONE); fCountLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER)); comp.setContent(container); comp.setMinHeight(250); comp.setExpandHorizontal(true); comp.setExpandVertical(true); return container; }
protected void createExampleControls(final Composite parent) { parent.setLayout(new GridLayout()); Group group1 = new Group(parent, SWT.NONE); group1.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); group1.setText("JFace Dialogs"); group1.setLayout(new GridLayout(3, true)); // JFace input dialog Button showInputDlgButton = new Button(group1, SWT.PUSH); showInputDlgButton.setText("Input Dialog"); showInputDlgButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(final SelectionEvent event) { showInputDialog(); } }); showInputDlgButton.setLayoutData(createGridDataFillBoth()); Button showProgressDlgButton = new Button(group1, SWT.PUSH); showProgressDlgButton.setText("ProgressDialog"); showProgressDlgButton.setLayoutData(createGridDataFillBoth()); showProgressDlgButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(final SelectionEvent e) { showProgressDialog(); } }); insertSpaceLabels(group1, 1); inputDlgResLabel = new Label(group1, SWT.WRAP); inputDlgResLabel.setText("Result:"); GridData gdInputDlgResLabel = new GridData(); gdInputDlgResLabel.horizontalSpan = 3; inputDlgResLabel.setLayoutData(gdInputDlgResLabel); Button showMessageInfoDlgButton = new Button(group1, SWT.PUSH); showMessageInfoDlgButton.setLayoutData(createGridDataFillBoth()); showMessageInfoDlgButton.setText("Info Message"); showMessageInfoDlgButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(final SelectionEvent event) { showMessageDialogInfo(); } }); Button showMessageWarningDlgButton = new Button(group1, SWT.PUSH); showMessageWarningDlgButton.setLayoutData(createGridDataFillBoth()); showMessageWarningDlgButton.setText("Warning Dialog"); showMessageWarningDlgButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(final SelectionEvent event) { showMessageDialogWarning(); } }); Button showMessageErrorDlgButton = new Button(group1, SWT.PUSH); showMessageErrorDlgButton.setLayoutData(createGridDataFillBoth()); showMessageErrorDlgButton.setText("Error Message"); showMessageErrorDlgButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(final SelectionEvent event) { showMessageDialogError(); } }); Button showMessageQuestionDlgButton = new Button(group1, SWT.PUSH); showMessageQuestionDlgButton.setLayoutData(createGridDataFillBoth()); showMessageQuestionDlgButton.setText("Question Dialog"); showMessageQuestionDlgButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(final SelectionEvent event) { showMessageDialogQuestion(); } }); Button showMessageConfirmDlgButton = new Button(group1, SWT.PUSH); showMessageConfirmDlgButton.setLayoutData(createGridDataFillBoth()); showMessageConfirmDlgButton.setText("Confirm Message"); showMessageConfirmDlgButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(final SelectionEvent event) { showMessageDialogConfirm(); } }); insertSpaceLabels(group1, 1); messageDlgResLabel = new Label(group1, SWT.WRAP); messageDlgResLabel.setText("Result:"); insertSpaceLabels(group1, 2); Button showErrorDlgButton = new Button(group1, SWT.PUSH); showErrorDlgButton.setLayoutData(createGridDataFillBoth()); showErrorDlgButton.setText("Error Dialog"); showErrorDlgButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(final SelectionEvent event) { showErrorDialog(); } }); insertSpaceLabels(group1, 2); errorDlgResLabel = new Label(group1, SWT.WRAP); errorDlgResLabel.setText("Result:"); insertSpaceLabels(group1, 2); Group group2 = new Group(parent, SWT.NONE); group2.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); group2.setText("Custom Dialogs"); group2.setLayout(new GridLayout(3, true)); Button showLoginDlgButton = new Button(group2, SWT.PUSH); showLoginDlgButton.setText("Login Dialog"); showLoginDlgButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(final SelectionEvent event) { showLoginDialog(); } }); showLoginDlgButton.setLayoutData(createGridDataFillBoth()); insertSpaceLabels(group2, 2); loginDlgResLabel = new Label(group2, SWT.WRAP); loginDlgResLabel.setText("Result:"); Group swtDialogsGroup = new Group(parent, SWT.NONE); swtDialogsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); swtDialogsGroup.setText("SWT Dialogs"); swtDialogsGroup.setLayout(new GridLayout(3, true)); showMessageBoxDlgButton = new Button(swtDialogsGroup, SWT.PUSH); showMessageBoxDlgButton.setText("MessageBox Dialog"); showMessageBoxDlgButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(final SelectionEvent event) { showMessageBoxDialog(); } }); showMessageBoxDlgButton.setLayoutData(createGridDataFillBoth()); showColorDialogButton = new Button(swtDialogsGroup, SWT.PUSH); showColorDialogButton.setText("ColorDialog"); showColorDialogButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(final SelectionEvent e) { showColorDialog(); } }); showColorDialogButton.setLayoutData(createGridDataFillBoth()); showFontDialogButton = new Button(swtDialogsGroup, SWT.PUSH); showFontDialogButton.setText("FontDialog"); showFontDialogButton.addSelectionListener( new SelectionAdapter() { public void widgetSelected(final SelectionEvent e) { showFontDialog(); } }); showFontDialogButton.setLayoutData(createGridDataFillBoth()); messageBoxDlgResLabel = new Label(swtDialogsGroup, SWT.WRAP); messageBoxDlgResLabel.setText("Result:"); GridData gdMessageBoxDlgResLabel = new GridData(); gdMessageBoxDlgResLabel.horizontalSpan = 3; messageBoxDlgResLabel.setLayoutData(gdMessageBoxDlgResLabel); }