List of usage examples for org.eclipse.jface.dialogs Dialog applyDialogFont
public static void applyDialogFont(Control control)
From source file:in.cypal.studio.gwt.ui.wizards.NewGwtEntryPointClassWizardPage.java
License:Apache License
public void createControl(Composite parent) { initializeDialogUnits(parent);/* w ww. j a va 2 s .com*/ Composite composite = new Composite(parent, SWT.NONE); composite.setFont(parent.getFont()); int nColumns = 4; GridLayout layout = new GridLayout(); layout.numColumns = nColumns; composite.setLayout(layout); // pick & choose the wanted UI components createProjectControls(composite, nColumns); createModuleControls(composite, nColumns); createSeparator(composite, nColumns); createTypeNameControls(composite, nColumns); createModifierControls(composite, nColumns); createSuperClassControls(composite, nColumns); createSuperInterfacesControls(composite, nColumns); createCommentControls(composite, nColumns); enableCommentControl(true); setControl(composite); Dialog.applyDialogFont(composite); List interfaceList = new ArrayList(1); interfaceList.add("com.google.gwt.core.client.EntryPoint"); //$NON-NLS-1$ setSuperClass("java.lang.Object", false);//$NON-NLS-1$ setSuperInterfaces(interfaceList, false); projectChanged(); }
From source file:in.cypal.studio.gwt.ui.wizards.NewGwtModuleWizardPage.java
License:Apache License
public void createControl(Composite parent) { initializeDialogUnits(parent);//from ww w . j ava 2s.c o m Composite composite = new Composite(parent, SWT.NONE); composite.setFont(parent.getFont()); int nColumns = 4; GridLayout layout = new GridLayout(); layout.numColumns = nColumns; composite.setLayout(layout); // pick & choose the wanted UI components createContainerControls(composite, nColumns); createPackageControls(composite, nColumns); // createEnclosingTypeControls(composite, nColumns); createSeparator(composite, nColumns); createTypeNameControls(composite, nColumns); // createModifierControls(composite, nColumns); // createSuperClassControls(composite, nColumns); createSuperInterfacesControls(composite, nColumns); // createMethodStubSelectionControls(composite, nColumns); createCommentControls(composite, nColumns); enableCommentControl(true); setControl(composite); Dialog.applyDialogFont(composite); List superInterfaces = new ArrayList(1); superInterfaces.add("com.google.gwt.core.client.EntryPoint"); //$NON-NLS-1$ setSuperInterfaces(superInterfaces, true); }
From source file:in.cypal.studio.gwt.ui.wizards.NewGwtRemoteServiceWizardPage.java
License:Apache License
public void createControl(Composite parent) { initializeDialogUnits(parent);/* w w w. ja va2 s. co m*/ Composite composite = new Composite(parent, SWT.NONE); composite.setFont(parent.getFont()); int nColumns = 4; GridLayout layout = new GridLayout(); layout.numColumns = nColumns; composite.setLayout(layout); createProjectControls(composite, nColumns); createModuleControls(composite, nColumns); createSeparator(composite, nColumns); createTypeNameControls(composite, nColumns); createSuperInterfacesControls(composite, nColumns); createServiceUriControls(composite, nColumns); createCommentControls(composite, nColumns); enableCommentControl(true); setControl(composite); Dialog.applyDialogFont(composite); List superInterfaces = new ArrayList(1); superInterfaces.add("com.google.gwt.user.client.rpc.RemoteService");//$NON-NLS-1$ setSuperInterfaces(superInterfaces, false); projectChanged(); }
From source file:info.evanchik.eclipse.karaf.ui.KarafConfigurationTab.java
License:Open Source License
@Override public void createControl(final Composite parent) { control = new Composite(parent, SWT.NONE); final GridLayout layout = new GridLayout(); control.setLayout(layout);//from w w w . ja v a 2 s. c o m final GridData gd = new GridData(GridData.FILL_HORIZONTAL); control.setLayoutData(gd); createConsoleBlock(control); createFeaturesBlock(control); setControl(control); Dialog.applyDialogFont(control); PlatformUI.getWorkbench().getHelpSystem().setHelp(control, ID); }
From source file:info.evanchik.eclipse.karaf.ui.wizards.provisioner.KarafInstallationSelectionPage.java
License:Open Source License
@Override public void createControl(final Composite parent) { final Composite client = new Composite(parent, SWT.NONE); final GridLayout layout = new GridLayout(); layout.numColumns = 2;/*from w w w. j ava2 s. co m*/ client.setLayout(layout); GridData data = new GridData(); data.horizontalSpan = 2; // The installation directory selection controls final Label label = new Label(client, SWT.NONE); label.setText("Installation directory"); data = new GridData(); data.horizontalSpan = 2; label.setLayoutData(data); Dialog.applyDialogFont(label); installDir = new Text(client, SWT.BORDER); data = new GridData(GridData.FILL_HORIZONTAL); installDir.setLayoutData(data); installDir.addModifyListener(new ModifyListener() { @Override public void modifyText(final ModifyEvent e) { validateWizardState(); } }); // File system browse button final Button browse = new Button(client, SWT.PUSH); browse.setText("Browse"); browse.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent se) { final DirectoryDialog dialog = new DirectoryDialog(KarafInstallationSelectionPage.this.getShell()); dialog.setMessage("Select Karaf installation directory"); dialog.setFilterPath(installDir.getText()); final String selectedDirectory = dialog.open(); if (selectedDirectory != null) { installDir.setText(selectedDirectory); } } }); final Group group = new Group(client, SWT.BORDER); group.setText("Karaf Platform Details"); group.setLayout(new GridLayout(2, false)); data = new GridData(GridData.FILL_BOTH); data.horizontalSpan = 2; group.setLayoutData(data); Label l = new Label(group, SWT.NONE); l.setText("Name"); Dialog.applyDialogFont(l); platformName = new Text(group, SWT.BORDER); data = new GridData(GridData.FILL_HORIZONTAL); platformName.setLayoutData(data); platformName.setEnabled(false); l = new Label(group, SWT.NONE); l.setText("Version"); Dialog.applyDialogFont(l); platformVersion = new Text(group, SWT.BORDER); data = new GridData(GridData.FILL_HORIZONTAL); platformVersion.setLayoutData(data); platformVersion.setEnabled(false); l = new Label(group, SWT.NONE); l.setText("Description"); Dialog.applyDialogFont(l); platformDescription = new Text(group, SWT.BORDER); data = new GridData(GridData.FILL_HORIZONTAL); platformDescription.setLayoutData(data); platformDescription.setEnabled(false); setControl(client); }
From source file:info.evanchik.eclipse.karaf.workbench.ui.editor.KarafPlatformEditorPart.java
License:Open Source License
@Override public void createPartControl(final Composite parent) { formToolkit = new FormToolkit(parent.getDisplay()); formToolkit.setBorderStyle(SWT.BORDER); form = formToolkit.createScrolledForm(parent); final GridLayout layout = new GridLayout(2, false); GridData data = new GridData(GridData.FILL_BOTH); data.horizontalSpan = 2;//from ww w.ja v a 2 s . c o m form.getBody().setLayout(layout); form.getBody().setLayoutData(data); final Section section = formToolkit.createSection(form.getBody(), Section.DESCRIPTION | Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED); section.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(final ExpansionEvent e) { form.reflow(true); } }); section.setText("Karaf Platform Overview"); section.setDescription("This is the description that goes below the title"); final Composite sectionClient = formToolkit.createComposite(section); sectionClient.setLayout(new GridLayout(2, false)); sectionClient.setLayoutData(data); section.setClient(sectionClient); Label l = formToolkit.createLabel(sectionClient, "Name"); Dialog.applyDialogFont(l); platformName = formToolkit.createText(sectionClient, platformDetails.getName(), SWT.BORDER); data = new GridData(GridData.FILL_HORIZONTAL); platformName.setLayoutData(data); platformName.setEnabled(false); l = formToolkit.createLabel(sectionClient, "Version"); Dialog.applyDialogFont(l); platformVersion = formToolkit.createText(sectionClient, platformDetails.getVersion(), SWT.BORDER); data = new GridData(GridData.FILL_HORIZONTAL); platformVersion.setLayoutData(data); platformVersion.setEnabled(false); l = formToolkit.createLabel(sectionClient, "Description"); Dialog.applyDialogFont(l); platformDescription = formToolkit.createText(sectionClient, platformDetails.getDescription(), SWT.BORDER); data = new GridData(GridData.FILL_HORIZONTAL); platformDescription.setLayoutData(data); platformDescription.setEnabled(false); }
From source file:info.evanchik.eclipse.karaf.wtp.ui.KarafRuntimeComposite.java
License:Open Source License
/** * Creates the necessary controls on this composite:<br> * <br>/*from w ww . j a va2 s . c o m*/ * - A text box for the name<br> * - A text box for the directory of the Karaf installation<br> */ private void createCompositeControls() { final GridLayout layout = new GridLayout(); layout.numColumns = 2; setLayout(layout); setLayoutData(new GridData(GridData.FILL_BOTH)); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, "org.apache.felix.karaf..."); /* * Runtime name label and text box * * The runtime name controls */ Label label = new Label(this, SWT.NONE); label.setText("Runtime name"); GridData data = new GridData(); data.horizontalSpan = 2; label.setLayoutData(data); name = new Text(this, SWT.BORDER); data = new GridData(GridData.FILL_HORIZONTAL); name.setLayoutData(data); name.addModifyListener(new ModifyListener() { @Override public void modifyText(final ModifyEvent e) { karafRuntimeWC.setName(name.getText()); validateWizardState(); } }); // The installation directory selection controls label = new Label(this, SWT.NONE); label.setText("Installation directory"); data = new GridData(); data.horizontalSpan = 2; label.setLayoutData(data); installDir = new Text(this, SWT.BORDER); data = new GridData(GridData.FILL_HORIZONTAL); installDir.setLayoutData(data); installDir.addModifyListener(new ModifyListener() { @Override public void modifyText(final ModifyEvent e) { karafRuntimeWC.setLocation(new Path(installDir.getText())); validateWizardState(); } }); // File system browse button final Button browse = KarafRuntimeUtils.createButton(this, "Browse"); browse.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(final SelectionEvent se) { final DirectoryDialog dialog = new DirectoryDialog(KarafRuntimeComposite.this.getShell()); dialog.setMessage("Select Karaf installation directory"); dialog.setFilterPath(installDir.getText()); final String selectedDirectory = dialog.open(); if (selectedDirectory != null) { installDir.setText(selectedDirectory); } } }); initializeWizard(); validateWizardState(); Dialog.applyDialogFont(this); name.forceFocus(); }
From source file:io.sarl.eclipse.log.IssueInformationPage.java
License:Apache License
@Override public void createControl(Composite parent) { // create a composite with standard margins and spacing final Composite composite = new Composite(parent, SWT.NONE); final GridLayout layout = new GridLayout(); layout.numColumns = 2;// ww w . ja v a 2 s. c om composite.setLayout(layout); composite.setLayoutData(new GridData(GridData.FILL_BOTH)); if (this.link != null) { final Link linkWidget = new Link(composite, SWT.BORDER); linkWidget.setText(MessageFormat.format(Messages.IssueInformationPage_9, this.link.toString())); linkWidget.setFont(composite.getFont()); final GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; linkWidget.setLayoutData(gd); linkWidget.addSelectionListener(new SelectionAdapter() { @SuppressWarnings("synthetic-access") @Override public void widgetSelected(SelectionEvent event) { try { final IWebBrowser browser = PlatformUI.getWorkbench().getBrowserSupport() .getExternalBrowser(); browser.openURL(IssueInformationPage.this.link); final IWizard wizard = IssueInformationPage.this.getWizard(); if (wizard instanceof SubmitEclipseLogWizard) { final WizardDialog dialog = ((SubmitEclipseLogWizard) wizard).getWizardDialog(); if (dialog != null) { dialog.close(); } } } catch (PartInitException e) { // } } }); } SWTFactory.createLabel(composite, Messages.IssueInformationPage_1, 1); this.titleField = SWTFactory.createSingleText(composite, 1); SWTFactory.createLabel(composite, Messages.IssueInformationPage_2, 1); this.descriptionField = SWTFactory.createText(composite, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL, 1); this.descriptionField.setLayoutData(new GridData(GridData.FILL_BOTH)); SWTFactory.createLabel(composite, Messages.IssueInformationPage_3, 1); this.trackerLogin = SWTFactory.createSingleText(composite, 1); SWTFactory.createLabel(composite, Messages.IssueInformationPage_4, 1); this.trackerPassword = SWTFactory.createSingleText(composite, 1); this.trackerPassword.setEchoChar(ECHO_CHAR); //add the listeners now to prevent them from monkeying with initialized settings this.titleField.addModifyListener((listeningEvent) -> { updatePageStatus(); }); this.descriptionField.addModifyListener((listeningEvent) -> { updatePageStatus(); }); this.trackerLogin.addModifyListener((listeningEvent) -> { updatePageStatus(); }); this.trackerPassword.addModifyListener((listeningEvent) -> { updatePageStatus(); }); Dialog.applyDialogFont(composite); setControl(composite); initFields(); updatePageStatus(); }
From source file:io.sarl.eclipse.wizards.sreinstall.StandardSREPage.java
License:Apache License
@Override public void createControl(Composite parent) { // create a composite with standard margins and spacing final Composite composite = new Composite(parent, SWT.NONE); final GridLayout layout = new GridLayout(); layout.numColumns = 3;/*from w ww. j av a 2 s.c o m*/ composite.setLayout(layout); composite.setLayoutData(new GridData(GridData.FILL_BOTH)); // SRE location SWTFactory.createLabel(composite, Messages.StandardSREPage_0, 1); this.sreLibraryTextField = SWTFactory.createSingleText(composite, 1); this.sreLibraryTextField.setEditable(false); final Button folders = SWTFactory.createPushButton(composite, Messages.StandardSREPage_1, null); final GridData data = (GridData) folders.getLayoutData(); data.horizontalAlignment = GridData.END; //SRE name SWTFactory.createLabel(composite, Messages.StandardSREPage_2, 1); this.sreNameTextField = SWTFactory.createSingleText(composite, 2); //SRE main class SWTFactory.createLabel(composite, Messages.StandardSREPage_3, 1); this.sreMainClassTextField = SWTFactory.createSingleText(composite, 2); //SRE Id SWTFactory.createLabel(composite, Messages.StandardSREPage_8, 1); this.sreIdTextField = SWTFactory.createSingleText(composite, 2); this.sreIdTextField.setEditable(false); //add the listeners now to prevent them from monkeying with initialized settings this.sreNameTextField.addModifyListener(new ModifyListener() { @SuppressWarnings("synthetic-access") @Override public void modifyText(ModifyEvent event) { StandardSREPage.this.workingCopy.setName(StandardSREPage.this.sreNameTextField.getText()); setPageStatus(validate()); updatePageStatus(); } }); this.sreMainClassTextField.addModifyListener(new ModifyListener() { @SuppressWarnings("synthetic-access") @Override public void modifyText(ModifyEvent event) { StandardSREPage.this.workingCopy.setMainClass(StandardSREPage.this.sreMainClassTextField.getText()); setPageStatus(validate()); updatePageStatus(); } }); folders.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { selectSRE(); } }); Dialog.applyDialogFont(composite); setControl(composite); //PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), //IJavaDebugHelpContextIds.EDIT_JRE_STD_VM_WIZARD_PAGE); setPageStatus(validate()); updatePageStatus(); initializeFields(); }
From source file:io.usethesource.impulse.preferences.AlternativePreferencesPage.java
License:Open Source License
protected Control createContents(Composite parent) { String message = getAlternativeMessage(); Label label = new Label(parent, SWT.WRAP); label.setText(message);/*from w w w. j av a 2s. c om*/ // Set the font on the page Dialog.applyDialogFont(parent); return label; }