List of usage examples for org.eclipse.jface.dialogs IDialogConstants OK_LABEL
String OK_LABEL
To view the source code for org.eclipse.jface.dialogs IDialogConstants OK_LABEL.
Click Source Link
From source file:com.google.gdt.eclipse.designer.util.ui.ResourceSelectionDialog.java
License:Open Source License
@Override protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); getButton(IDialogConstants.OK_ID).setEnabled(false); }
From source file:com.htmlhifive.tools.jslint.dialog.ConfirmLicenseDialog.java
License:Apache License
@Override protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true).setEnabled(false); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); initialDataBinding();/*from www . ja va 2 s.co m*/ textLicenseText.setText(license); }
From source file:com.htmlhifive.tools.jslint.dialog.CreateEngineDialog.java
License:Apache License
@Override protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); initialDataBinding();//from w w w. j ava 2s. co m setMessage(Messages.DL0027.getText(), IMessageProvider.INFORMATION); }
From source file:com.htmlhifive.tools.jslint.dialog.CreateOptionFileDialog.java
License:Apache License
@Override protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true).setEnabled(false); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); }
From source file:com.iauto.mist.spec.m2t.uml2html.dialog.ModelURIChooseDialog.java
License:Open Source License
/** * Creates a new clean dialog.//from w ww .j a v a 2s. c om * * @param window * the window to create it in * @param selection * the currently selected projects (may be empty) */ public ModelURIChooseDialog(IWorkbenchWindow window, List<Model> mdlList, List<Model> selection) { super(window.getShell(), "Select Model URI", null, getQuestion(), NONE, new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0); this.window = window; Collections.sort(mdlList, new Comparator<Model>() { public int compare(Model arg0, Model arg1) { return arg0.getName().compareTo(arg1.getName()); } }); this.original = mdlList; this.selection = selection.toArray(new Model[selection.size()]); if (this.selection == null) { this.selection = new Object[0]; } }
From source file:com.iauto.mist.spec.m2t.uml2html.dialog.StateMachineChooseDialog.java
License:Open Source License
/** * Creates a new clean dialog./*from w w w . ja v a 2 s . c om*/ * * @param window * the window to create it in * @param selection * the currently selected projects (may be empty) */ public StateMachineChooseDialog(IWorkbenchWindow window, List<StateMachine> smList, List<StateMachine> selection) { super(window.getShell(), "Select", null, getQuestion(), NONE, new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0); this.window = window; Collections.sort(smList, new Comparator<StateMachine>() { public int compare(StateMachine arg0, StateMachine arg1) { return arg0.getName().compareTo(arg1.getName()); } }); this.original = smList; this.selection = selection.toArray(new StateMachine[selection.size()]); if (this.selection == null) { this.selection = new Object[0]; } }
From source file:com.ibm.domino.osgi.debug.actions.CreateNotesJavaApiProject.java
License:Open Source License
/** * The action has been activated. The argument of the * method represents the 'real' action sitting * in the workbench UI.//from w w w. j a va 2 s. c om * @see IWorkbenchWindowActionDelegate#run */ public void run(IAction action) { if (exists(getBinDirectoryFromPreferenceStore())) { doCreateNotesJavaApiProject(); return; } int status = new MessageDialog(window.getShell(), "Question", null, "Domino Bin directory not set, please click on the link to set it", MessageDialog.WARNING, new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0) { @Override protected Control createCustomArea(Composite parent) { Link link = new Link(parent, SWT.NONE); link.setFont(parent.getFont()); link.setText("<A>Domino Debug Plugin Preferences....</A>"); link.addSelectionListener(new SelectionListener() { /* * (non-Javadoc) * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent) */ public void widgetSelected(SelectionEvent e) { doLinkActivated(); } /* * Open the appropriate preference page */ private void doLinkActivated() { String id = "com.ibm.domino.osgi.debug.preferences.DominoOSGiDebugPreferencePage"; PreferencesUtil.createPreferenceDialogOn(window.getShell(), id, new String[] { id }, null) .open(); updateButtons(); } public void widgetDefaultSelected(SelectionEvent e) { doLinkActivated(); } }); return link; } private void updateButtons() { getButton(0).setEnabled(exists(getBinDirectoryFromPreferenceStore())); } protected Control createContents(Composite parent) { Control ctrl = super.createContents(parent); updateButtons(); return ctrl; }; }.open(); if (status == MessageDialog.OK) { doCreateNotesJavaApiProject(); } }
From source file:com.ibm.domino.osgi.debug.actions.CreateNotesJavaApiProject.java
License:Open Source License
private void doCreateNotesJavaApiProject() { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); final IProject project = root.getProject(JAVA_API_PROJECT_NAME); if (project.exists()) { boolean bContinue = MessageDialog.openQuestion(window.getShell(), "Debug plug-in for Domino OSGi", MessageFormat.format("Project {0} already exists. Would you like to update it?", JAVA_API_PROJECT_NAME)); if (!bContinue) { return; }//from w w w .jav a 2s . c om } String binDirectory = Activator.getDefault().getPreferenceStore() .getString(PreferenceConstants.PREF_DOMINO_BIN_DIR); if (binDirectory == null || binDirectory.length() == 0) { int ret = new MessageDialog(window.getShell(), "Question", null, "Domino Bin directory not set, please click on the link to set it", MessageDialog.WARNING, new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0) { /* * (non-Javadoc) * @see org.eclipse.jface.dialogs.MessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite) */ @Override protected Control createCustomArea(Composite parent) { Link link = new Link(parent, SWT.NONE); link.setFont(parent.getFont()); link.setText("<A>Domino Debug Plugin Preferences....</A>"); link.addSelectionListener(new SelectionListener() { public void widgetSelected(SelectionEvent e) { doLinkActivated(); } private void doLinkActivated() { String id = "com.ibm.domino.osgi.debug.preferences.DominoOSGiDebugPreferencePage"; PreferencesUtil .createPreferenceDialogOn(window.getShell(), id, new String[] { id }, null) .open(); } public void widgetDefaultSelected(SelectionEvent e) { doLinkActivated(); } }); return link; } }.open(); if (ret == 1) { return; } } binDirectory = Activator.getDefault().getPreferenceStore() .getString(PreferenceConstants.PREF_DOMINO_BIN_DIR); if (binDirectory == null || binDirectory.length() == 0) { MessageDialog.openError(window.getShell(), "Error", "Domino Bin directory not set"); return; } try { final String sBinDir = binDirectory; new ProgressMonitorDialog(window.getShell()).run(true, true, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { if (!project.exists()) { project.create(monitor); } project.open(monitor); IProjectDescription description = project.getDescription(); String[] natures = description.getNatureIds(); String[] newNatures = new String[natures.length + 2]; System.arraycopy(natures, 0, newNatures, 0, natures.length); newNatures[natures.length] = JavaCore.NATURE_ID; newNatures[natures.length + 1] = "org.eclipse.pde.PluginNature"; description.setNatureIds(newNatures); project.setDescription(description, monitor); //Copy the resources under res copyOneLevel(project, monitor, "res", ""); //Copy notes.jar File notesJar = new File(sBinDir + "/jvm/lib/ext/Notes.jar"); if (!notesJar.exists() || !notesJar.isFile()) { MessageDialog.openError(window.getShell(), "Error", MessageFormat.format("{0} does not exist", notesJar.getAbsolutePath())); return; } copyFile(notesJar, project.getFile("Notes.jar"), monitor); } catch (Throwable t) { throw new InvocationTargetException(t); } } }); } catch (Throwable t) { MessageDialog.openError(window.getShell(), "error", t.getMessage()); t.printStackTrace(); } }
From source file:com.ibm.research.tagging.core.ui.dialogs.QuickTagDialog.java
License:Open Source License
protected void createButtonsForButtonBar(Composite parent) { // create OK and Cancel buttons by default okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); //do this here because setting the text will set enablement on the ok button fTagsText.getTextControl().setFocus(); }
From source file:com.ibm.research.tagging.java.dialogs.SynchronizeWaypointsDialog.java
License:Open Source License
/** * Creates a new RefreshTagsDialog dialog. * //from w w w . j a va 2s. c om * @param window the window to create it in * @param selection the currently selected projects (may be empty) */ public SynchronizeWaypointsDialog(IWorkbenchWindow window, IProject[] selection) { super(window.getShell(), "Synchronize @tag database...", null, getQuestion(), QUESTION, new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, 0); this.fSelection = selection; if (this.fSelection == null) { this.fSelection = new Object[0]; } setShellStyle(SWT.RESIZE | getShellStyle()); //setDefaultImage(); }