List of usage examples for org.eclipse.jface.dialogs Dialog applyDialogFont
public static void applyDialogFont(Control control)
From source file:com.cisco.yangide.ui.internal.preferences.YangBasePreferencePage.java
License:Open Source License
@Override protected Control createContents(Composite parent) { Composite pageArea = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(1, true); pageArea.setLayout(layout);//from w w w. j a va 2 s .c o m cleanBtn = new Button(pageArea, SWT.CHECK); cleanBtn.setText(Messages.pref_Base_cleanCodeGen); cleanBtn.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false)); cleanBtn.setSelection(getPreferenceStore().getBoolean(YangPreferenceConstants.M2E_PLUGIN_CLEAN_TARGET)); tracingBtn = new Button(pageArea, SWT.CHECK); tracingBtn.setText(Messages.pref_Base_enableTracing); tracingBtn.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false)); tracingBtn.setSelection(getPreferenceStore().getBoolean(YangPreferenceConstants.ENABLE_TRACING)); Dialog.applyDialogFont(pageArea); return pageArea; }
From source file:com.conwet.wirecloud.ide.wizards.WizardProjectsImportPage.java
License:Open Source License
public void createControl(Composite parent) { initializeDialogUnits(parent);// w ww . j ava2s . com Composite workArea = new Composite(parent, SWT.NONE); setControl(workArea); workArea.setLayout(new GridLayout()); workArea.setLayoutData( new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL)); createProjectsRoot(workArea); createProjectsList(workArea); createOptionsGroup(workArea); Dialog.applyDialogFont(workArea); }
From source file:com.conwet.wirecloud.ide.wizards.WizardProjectsImportPage.java
License:Open Source License
/** * Create the selection buttons in the listComposite. * * @param listComposite/* ww w . ja v a 2 s .c o m*/ */ private void createSelectionButtons(Composite listComposite) { Composite buttonsComposite = new Composite(listComposite, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginWidth = 0; layout.marginHeight = 0; buttonsComposite.setLayout(layout); buttonsComposite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING)); Button selectAll = new Button(buttonsComposite, SWT.PUSH); selectAll.setText(DataTransferMessages.DataTransfer_selectAll); selectAll.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { for (int i = 0; i < selectedProjects.length; i++) { if (selectedProjects[i].hasConflicts) projectsList.setChecked(selectedProjects[i], false); else projectsList.setChecked(selectedProjects[i], true); } setPageComplete(projectsList.getCheckedElements().length > 0); } }); Dialog.applyDialogFont(selectAll); setButtonLayoutData(selectAll); Button deselectAll = new Button(buttonsComposite, SWT.PUSH); deselectAll.setText(DataTransferMessages.DataTransfer_deselectAll); deselectAll.addSelectionListener(new SelectionAdapter() { /* * (non-Javadoc) * * @see * org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse * .swt.events.SelectionEvent) */ public void widgetSelected(SelectionEvent e) { projectsList.setCheckedElements(new Object[0]); setPageComplete(false); } }); Dialog.applyDialogFont(deselectAll); setButtonLayoutData(deselectAll); Button refresh = new Button(buttonsComposite, SWT.PUSH); refresh.setText(DataTransferMessages.DataTransfer_refresh); refresh.addSelectionListener(new SelectionAdapter() { /* * (non-Javadoc) * * @see * org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse * .swt.events.SelectionEvent) */ public void widgetSelected(SelectionEvent e) { if (projectFromDirectoryRadio.getSelection()) { updateProjectsList(directoryPathField.getText().trim()); } else { updateProjectsList(archivePathField.getText().trim()); } } }); Dialog.applyDialogFont(refresh); setButtonLayoutData(refresh); }
From source file:com.dubture.composer.ui.wizard.AbstractWizardFirstPage.java
@Override public void createControl(Composite parent) { composite = new Composite(parent, SWT.NULL); composite.setFont(parent.getFont()); composite.setLayout(initGridLayout(new GridLayout(1, false), false)); composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); initialName = ""; // create UI elements nameGroup = new NameGroup(composite, initialName, getShell()); nameGroup.addObserver(this); validator = getValidator();//from w ww .ja v a 2s. co m beforeLocationGroup(); PHPLocationGroup = new LocationGroup(composite, nameGroup, getShell()); CompositeData data = new CompositeData(); data.setParetnt(composite); data.setSettings(getDialogSettings()); data.setObserver(PHPLocationGroup); versionGroup = new VersionGroup(this, composite); detectGroup = new DetectGroup(composite, PHPLocationGroup, nameGroup); nameGroup.addObserver(PHPLocationGroup); PHPLocationGroup.addObserver(detectGroup); // initialize all elements nameGroup.notifyObservers(); // create and connect validator nameGroup.addObserver(validator); PHPLocationGroup.addObserver(validator); Dialog.applyDialogFont(composite); afterLocationGroup(); setControl(composite); composerPackage = new ComposerPackage(); keywordConverter = new String2KeywordsConverter(composerPackage); finishControlSetup(); setHelpContext(composite); }
From source file:com.dubture.symfony.debug.launch.LaunchConfigurationTab.java
License:Open Source License
@Override public void createControl(Composite parent) { Font font = parent.getFont(); comp = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(1, true); comp.setLayout(layout);/*from w ww . ja v a 2 s . c o m*/ comp.setFont(font); GridData gd = new GridData(GridData.FILL_BOTH); comp.setLayoutData(gd); setControl(comp); // setHelpContextId(); Group group = new Group(comp, SWT.NONE); group.setFont(font); layout = new GridLayout(); group.setLayout(layout); group.setLayoutData(new GridData(GridData.FILL_BOTH)); String controlName = "Launch Settings"; group.setText(controlName); Label label = new Label(group, SWT.NONE); label.setText("Environment"); GridData data = new GridData(200, GridData.FILL, true, false); label.setLayoutData(data); kernelCombo = new Combo(group, SWT.READ_ONLY); data = new GridData(); data.horizontalIndent = 0; kernelCombo.setLayoutData(data); kernelCombo.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { for (AppKernel k : kernels) { String env = kernelCombo.getItem(kernelCombo.getSelectionIndex()); if (env.equals(k.getEnvironment())) { kernel = k; break; } } setDirty(true); updateLaunchConfigurationDialog(); updateURL(); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }); Label routeLabel = new Label(group, SWT.NONE); routeLabel.setText("Route"); route = new Text(group, SWT.SINGLE | SWT.BORDER); data = new GridData(); data.widthHint = 200; route.addKeyListener(routeListener); route.addFocusListener(new FocusListener() { @Override public void focusLost(FocusEvent e) { currentRoute = model.findRoute(route.getText(), project); setDirty(true); updateLaunchConfigurationDialog(); updateURL(); } @Override public void focusGained(FocusEvent e) { } }); route.setLayoutData(data); ac = new AutoCompleteField(route, new TextContentAdapter(), new String[] {}); Label urlLabel = new Label(group, SWT.NONE); urlLabel.setText("Generated URL"); url = new Text(group, SWT.BORDER | SWT.SINGLE); url.addKeyListener(new KeyListener() { @Override public void keyReleased(KeyEvent e) { } @Override public void keyPressed(KeyEvent e) { setDirty(true); updateLaunchConfigurationDialog(); } }); data = new GridData(GridData.FILL, GridData.VERTICAL_ALIGN_BEGINNING, true, false); url.setLayoutData(data); Dialog.applyDialogFont(comp); setControl(comp); }
From source file:com.dubture.symfony.ui.wizards.project.SymfonyProjectWizardFirstPage.java
License:Open Source License
@Override public void createControl(Composite parent) { final Composite composite = new Composite(parent, SWT.NULL); composite.setFont(parent.getFont()); composite.setLayout(initGridLayout(new GridLayout(1, false), false)); composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); initialName = ""; nameGroup = new NameGroup(composite, initialName, getShell()); nameGroup.addObserver(this); PHPLocationGroup = new SymfonyLocationGroup(composite, nameGroup, getShell()); CompositeData data = new CompositeData(); data.setParetnt(composite);/*ww w. j a v a 2s. c om*/ data.setSettings(getDialogSettings()); data.setObserver(PHPLocationGroup); versionGroup = new SymfonyVersionGroup(this, composite); nameGroup.addObserver(PHPLocationGroup); nameGroup.notifyObservers(); projectTemplateValidator = new Validator(this) { @Override protected void finishValidation() throws ValidationException { String executable = Platform.getPreferencesService().getString(ComposerPlugin.ID, Keys.PHP_EXECUTABLE, null, null); if (executable == null || executable.isEmpty()) { // the user has not set any preference for PHP executable yet, // so try finding any PHP executable, e.g. contributed via the // phpExe extension point try { executable = LaunchUtil.getPHPExecutable(); } catch (ExecutableNotFoundException e) { // still no php exe found throw new ValidationException( "No PHP executable defined. Please specify a valid executable in the PHP Executables preference page.", Severity.ERROR); } } } }; nameGroup.addObserver(projectTemplateValidator); PHPLocationGroup.addObserver(projectTemplateValidator); Dialog.applyDialogFont(composite); setControl(composite); composerPackage = new ComposerPackage(); keywordConverter = new String2KeywordsConverter(composerPackage); setHelpContext(composite); setPageComplete(false); }
From source file:com.ebmwebsourcing.petals.services.sa.refactoring.SaRefactorUserPage.java
License:Open Source License
public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); GridLayout gridLayout = new GridLayout(2, false); gridLayout.marginWidth = 10;/*from ww w . ja v a2 s . co m*/ gridLayout.marginHeight = 10; container.setLayout(gridLayout); container.setLayoutData(new GridData(GridData.FILL_BOTH)); initializeDialogUnits(container); Dialog.applyDialogFont(container); Label l = new Label(container, SWT.NONE); l.setText("New name:"); this.text = new Text(container, SWT.SINGLE | SWT.BORDER); this.text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); this.text.setText(getInfo().getNewName()); this.text.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { getInfo().setNewName(SaRefactorUserPage.this.text.getText()); validate(); } }); setControl(container); validate(); this.text.selectAll(); }
From source file:com.ebmwebsourcing.petals.services.su.refactoring.SuRefactorUserPage.java
License:Open Source License
public void createControl(Composite parent) { Composite container = new Composite(parent, SWT.NONE); GridLayout gridLayout = new GridLayout(2, false); gridLayout.marginWidth = 10;/*from ww w . ja v a2s . co m*/ gridLayout.marginHeight = 10; container.setLayout(gridLayout); container.setLayoutData(new GridData(GridData.FILL_BOTH)); initializeDialogUnits(container); Dialog.applyDialogFont(container); // Name Label l = new Label(container, SWT.NONE); l.setText("New name:"); this.text = new Text(container, SWT.SINGLE | SWT.BORDER); this.text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); this.text.setText(getInfo().getNewName()); this.text.selectAll(); this.text.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { getInfo().setNewName(SuRefactorUserPage.this.text.getText()); validate(); } }); // Update the service name this.serviceNameButton = new Button(container, SWT.CHECK); this.serviceNameButton.setText("Extract and update the service name"); GridData layoutData = new GridData(); layoutData.horizontalSpan = 2; layoutData.verticalIndent = 10; this.serviceNameButton.setLayoutData(layoutData); this.serviceNameButton.setSelection(true); getInfo().getOptions().put(RefactoringExtensionForSu.UPDATE_SERVICE_NAME, true); getInfo().getOptions().put(RefactoringExtensionForSu.UPDATE_DERIVED_NAMES, false); this.serviceNameButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { Boolean update = getInfo().getOptions().get(RefactoringExtensionForSu.UPDATE_SERVICE_NAME); if (update == null) update = true; else update = !update; getInfo().getOptions().put(RefactoringExtensionForSu.UPDATE_SERVICE_NAME, update); validate(); } }); // Update the derived names this.derivedButton = new Button(container, SWT.CHECK); this.derivedButton.setText("Update the service name's derivations"); layoutData = new GridData(); layoutData.horizontalSpan = 2; this.derivedButton.setLayoutData(layoutData); this.derivedButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { Boolean update = getInfo().getOptions().get(RefactoringExtensionForSu.UPDATE_DERIVED_NAMES); if (update == null) update = true; else update = !update; getInfo().getOptions().put(RefactoringExtensionForSu.UPDATE_DERIVED_NAMES, update); validate(); } }); setControl(container); validate(); }
From source file:com.elphel.vdt.ui.tools.LaunchConfigurationTab.java
License:Open Source License
public void createControl(Composite parent) { GridLayout layout = new GridLayout(2, false); layout.marginHeight = 5;/*from w ww. j av a 2 s .com*/ layout.marginWidth = 5; layout.verticalSpacing = 3; layout.horizontalSpacing = 5; Composite panel = new Composite(parent, SWT.NONE); for (Iterator<AbstractTabComponent> i = components.iterator(); i.hasNext();) ((AbstractTabComponent) i.next()).createControl(panel); // do the common stuff setControl(panel); panel.setFont(parent.getFont()); GridData gridData = new GridData(GridData.FILL_HORIZONTAL); panel.setLayout(layout); panel.setLayoutData(gridData); createVerticalSpacer(panel, 1); Dialog.applyDialogFont(parent); }
From source file:com.foglyn.ui.FoglynQueryTypeWizardPage.java
License:Open Source License
public void createControl(Composite parent) { composite = new Composite(parent, SWT.NONE); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).applyTo(composite); composite.setLayout(new MigLayout()); buttonFilter = new Button(composite, SWT.RADIO); buttonFilter.setText("Query based on your saved FogBugz filter"); buttonFilter.setSelection(true);/*from www .ja va 2 s. co m*/ buttonFilter.setLayoutData("span"); buttonSearch = new Button(composite, SWT.RADIO); buttonSearch.setText("Query based on search options"); buttonSearch.setLayoutData("span"); setPageComplete(true); setControl(composite); Dialog.applyDialogFont(composite); }