List of usage examples for org.eclipse.jface.dialogs IDialogConstants CANCEL_ID
int CANCEL_ID
To view the source code for org.eclipse.jface.dialogs IDialogConstants CANCEL_ID.
Click Source Link
From source file:ext.org.eclipse.jdt.internal.ui.packageview.GotoTypeAction.java
License:Open Source License
@Override public void run() { Shell shell = JavaPlugin.getActiveWorkbenchShell(); SelectionDialog dialog = null;/*from w ww. j a v a 2 s .c o m*/ try { dialog = JavaUI.createTypeDialog(shell, new ProgressMonitorDialog(shell), SearchEngine.createWorkspaceScope(), IJavaElementSearchConstants.CONSIDER_ALL_TYPES, false); } catch (JavaModelException e) { String title = getDialogTitle(); String message = PackagesMessages.GotoType_error_message; ExceptionHandler.handle(e, title, message); return; } dialog.setTitle(getDialogTitle()); dialog.setMessage(PackagesMessages.GotoType_dialog_message); if (dialog.open() == IDialogConstants.CANCEL_ID) { return; } Object[] types = dialog.getResult(); if (types != null && types.length > 0) { gotoType((IType) types[0]); } }
From source file:ext.org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.java
License:Open Source License
public boolean activate(RefactoringWizard wizard, Shell parent, String dialogTitle, int saveMode) { RefactoringSaveHelper saveHelper = new RefactoringSaveHelper(saveMode); if (!canActivate(saveHelper, parent)) return false; try {//from ww w . j av a 2s . co m RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard); int result = op.run(parent, dialogTitle); fStatus = op.getInitialConditionCheckingStatus(); if (result == IDialogConstants.CANCEL_ID || result == RefactoringWizardOpenOperation.INITIAL_CONDITION_CHECKING_FAILED) { saveHelper.triggerIncrementalBuild(); return false; } else { return true; } } catch (InterruptedException e) { return false; // User action got cancelled } }
From source file:fr.inria.linuxtools.tmf.ui.views.uml2sd.dialogs.SearchFilterDialog.java
License:Open Source License
/** * Open the dialog box/* ww w .ja v a2 s.co m*/ */ @Override public int open() { create(); if (fCriteria == null) { loadCriteria(); } if (fCriteria == null) { fCriteria = new Criteria(); fCriteria.setLifeLineSelected(fProvider.isNodeSupported(ISDGraphNodeSupporter.LIFELINE)); fCriteria.setSyncMessageSelected(fProvider.isNodeSupported(ISDGraphNodeSupporter.SYNCMESSAGE)); fCriteria.setSyncMessageReturnSelected( fProvider.isNodeSupported(ISDGraphNodeSupporter.SYNCMESSAGERETURN)); fCriteria.setAsyncMessageSelected(fProvider.isNodeSupported(ISDGraphNodeSupporter.ASYNCMESSAGE)); fCriteria.setAsyncMessageReturnSelected( fProvider.isNodeSupported(ISDGraphNodeSupporter.ASYNCMESSAGERETURN)); fCriteria.setStopSelected(fProvider.isNodeSupported(ISDGraphNodeSupporter.STOP)); } copyFromCriteria(fCriteria); if (fOkText != null) { getButton(IDialogConstants.OK_ID).setText(fOkText); } else { getButton(IDialogConstants.OK_ID).setText(Messages.SequenceDiagram_Find); } if (fIsFind) { getButton(IDialogConstants.CANCEL_ID).setText(Messages.SequenceDiagram_Close); } Button okButton = getButton(IDialogConstants.OK_ID); ((TabContents) getDialogArea()).setOkButton(okButton); if (fCriteria == null || !((fCriteria.getExpression() != null && !fCriteria.getExpression().equals("")) && //$NON-NLS-1$ (fCriteria.isAsyncMessageReturnSelected() || fCriteria.isAsyncMessageSelected() || fCriteria.isLifeLineSelected() || fCriteria.isStopSelected() || fCriteria.isSyncMessageReturnSelected() || fCriteria.isSyncMessageSelected()))) { okButton.setEnabled(false); } if (fTitle != null) { getShell().setText(fTitle); } else { getShell().setText(Messages.SequenceDiagram_SequenceDiagramFind); } getShell().pack(); getShell().setLocation(getShell().getDisplay().getCursorLocation()); fCriteria = null; return super.open(); }
From source file:fr.inria.soctrace.framesoc.ui.dialogs.AbstractLaunchToolDialog.java
License:Open Source License
@Override protected void createButtonsForButtonBar(Composite parent) { // create OK and Cancel buttons by default createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); // OK enabled only if the Framesoc tool says so updateOk();/* w w w .j a va2s .co m*/ }
From source file:fr.inria.soctrace.tools.ocelotl.ui.views.OcelotlSettingsView.java
License:Open Source License
/** * Add button to save the settings/*w w w.ja v a 2s.com*/ */ @Override protected void createButtonsForButtonBar(Composite parent) { // Change parent layout data to fill the whole bar parent.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); saveSettingsButton = createButton(parent, IDialogConstants.NO_ID, "Save Settings", false); saveSettingsButton.setToolTipText("Set Current Settings as Default Ocelotl Settings"); saveSettingsButton.addSelectionListener(new SaveSettingsListener()); // Create a spacer label Label spacer = new Label(parent, SWT.NONE); spacer.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); // Update layout of the parent composite to count the spacer GridLayout layout = (GridLayout) parent.getLayout(); layout.numColumns++; layout.makeColumnsEqualWidth = false; createButton(parent, IDialogConstants.CANCEL_ID, "Cancel", false); createButton(parent, IDialogConstants.OK_ID, "OK", true); }
From source file:fr.liglab.adele.cilia.workbench.common.ui.dialog.WorkbenchDialog.java
License:Apache License
protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); if (hasCancelButton) createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); }
From source file:fr.lip6.move.coloane.projects.its.dialogs.AddTypeDialog.java
License:Open Source License
/** * {@inheritDoc}/*from www .j a v a2 s .com*/ */ @Override protected void createButtonsForButtonBar(Composite parent) { ((GridLayout) parent.getLayout()).numColumns++; ((GridLayout) parent.getLayout()).numColumns++; createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true); createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); }
From source file:fr.ocelet.platform.dialogs.AboutOmpDialog.java
License:CeCILL license
@Override protected Button createButton(Composite parent, int id, String label, boolean defaultButton) { if (id == IDialogConstants.CANCEL_ID) return null; return super.createButton(parent, id, label, defaultButton); }
From source file:gda.rcp.Application.java
License:Open Source License
private int identifyVisitID(Display display) throws Exception { if (!IcatProvider.getInstance().icatInUse()) { logger.info("Icat database not in use. Using the default visit defined by property " + LocalProperties.GDA_DEF_VISIT); setToDefaultVisit();// w w w . ja v a 2 s .com return 1; } // test if the result has multiple entries String user = UserAuthentication.getUsername(); VisitEntry[] visits; try { visits = IcatProvider.getInstance().getMyValidVisits(user); } catch (Exception e) { logger.info( e.getMessage() + " - using default visit defined by property " + LocalProperties.GDA_DEF_VISIT, e); setToDefaultVisit(); return 1; } boolean isStaff = false; try { if (AuthoriserProvider.getAuthoriser().isLocalStaff(user)) { isStaff = true; } } catch (ClassNotFoundException e) { logger.error("Problem checking if user is staff. Assuming user IS staff.", e); isStaff = true; } // if no valid visit ID then do same as the cancel button if (visits == null || visits.length == 0) { if (!isStaff) { logger.info( "No visits found for user " + user + " at this time on this beamline. GUI will not start."); return EXIT_OK; } logger.info("No visits found for user " + user + " at this time on this beamline. Will use default visit as ID listed as a member of staff."); setToDefaultVisit(); } else if (visits.length == 1) { LocalProperties.set(LocalProperties.RCP_APP_VISIT, visits[0].getVisitID()); } else { // send array of visits to dialog to pick one String[][] visitInfo = new String[visits.length][]; int i = 0; for (VisitEntry visit : visits) { visitInfo[i] = new String[] { visit.getVisitID(), visit.getTitle() }; i++; } final VisitIDDialog visitDialog = new VisitIDDialog(display, visitInfo); if (visitDialog.open() == IDialogConstants.CANCEL_ID) { logger.info("Cancel pressed in visit chooser dialog. GUI will not continue."); return EXIT_OK; } if (visitDialog.getChoosenID() == null) { logger.info("Visit not resolved from visit chooser dialog. GUI will not start."); return EXIT_OK; } LocalProperties.set(LocalProperties.RCP_APP_VISIT, visitDialog.getChoosenID()); } return 1; }