List of usage examples for org.eclipse.jface.dialogs IDialogConstants CLOSE_ID
int CLOSE_ID
To view the source code for org.eclipse.jface.dialogs IDialogConstants CLOSE_ID.
Click Source Link
From source file:org.eclipse.e4.ui.internal.progress.ProgressMonitorFocusJobDialog.java
License:Open Source License
@Override protected void createButtonsForButtonBar(Composite parent) { Button runInWorkspace = createButton(parent, IDialogConstants.CLOSE_ID, ProgressMessages.ProgressMonitorFocusJobDialog_RunInBackgroundButton, true); runInWorkspace.addSelectionListener(new SelectionAdapter() { @Override// w w w . j ava 2s .c o m public void widgetSelected(SelectionEvent e) { job.setProperty(IProgressConstants.PROPERTY_IN_DIALOG, Boolean.FALSE); finishedRun(); } }); runInWorkspace.setCursor(arrowCursor); cancel = createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); cancel.setCursor(arrowCursor); createDetailsButton(parent); }
From source file:org.eclipse.e4.ui.progress.internal.ProgressMonitorFocusJobDialog.java
License:Open Source License
@Override protected void createButtonsForButtonBar(Composite parent) { Button runInWorkspace = createButton(parent, IDialogConstants.CLOSE_ID, ProgressMessages.ProgressMonitorFocusJobDialog_RunInBackgroundButton, true); runInWorkspace.addSelectionListener(new SelectionAdapter() { @Override/*from ww w . j av a2s. c o m*/ public void widgetSelected(SelectionEvent e) { // Rectangle shellPosition = getShell().getBounds(); job.setProperty(IProgressConstants.PROPERTY_IN_DIALOG, Boolean.FALSE); finishedRun(); //TODO E4 //ProgressManagerUtil.animateDown(shellPosition); } }); runInWorkspace.setCursor(arrowCursor); cancel = createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); cancel.setCursor(arrowCursor); createDetailsButton(parent); }
From source file:org.eclipse.edt.ide.ui.internal.contentassist.EGLContentAssistProcessor.java
License:Open Source License
private boolean informUserAboutEmptyDefaultCategory() { if (OptionalMessageDialog.isDialogEnabled(PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY)) { final Shell shell = EDTUIPlugin.getActiveWorkbenchShell(); String title = EGLTextMessages.ContentAssistProcessor_all_disabled_title; String message = EGLTextMessages.ContentAssistProcessor_all_disabled_message; // see PreferencePage#createControl for the 'defaults' label final String restoreButtonLabel = JFaceResources.getString("defaults"); //$NON-NLS-1$ final String linkMessage = Messages.format( EGLTextMessages.ContentAssistProcessor_all_disabled_preference_link, LegacyActionTools.removeMnemonics(restoreButtonLabel)); final int restoreId = IDialogConstants.CLIENT_ID + 10; final int settingsId = IDialogConstants.CLIENT_ID + 11; final OptionalMessageDialog dialog = new OptionalMessageDialog(PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY, shell, title, null /* default image */, message, MessageDialog.WARNING, new String[] { restoreButtonLabel, IDialogConstants.CLOSE_LABEL }, 1) { /*//from w ww .j a v a 2s . c o m * @see org.eclipse.jdt.internal.ui.dialogs.OptionalMessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite) */ protected Control createCustomArea(Composite composite) { // wrap link and checkbox in one composite without space Composite parent = new Composite(composite, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginHeight = 0; layout.marginWidth = 0; layout.verticalSpacing = 0; parent.setLayout(layout); Composite linkComposite = new Composite(parent, SWT.NONE); layout = new GridLayout(); layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); linkComposite.setLayout(layout); Link link = new Link(linkComposite, SWT.NONE); link.setText(linkMessage); link.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { setReturnCode(settingsId); close(); } }); GridData gridData = new GridData(SWT.FILL, SWT.BEGINNING, true, false); gridData.widthHint = this.getMinimumMessageWidth(); link.setLayoutData(gridData); super.createCustomArea(parent); return parent; } protected void createButtonsForButtonBar(Composite parent) { Button[] buttons = new Button[2]; buttons[0] = createButton(parent, restoreId, restoreButtonLabel, false); buttons[1] = createButton(parent, IDialogConstants.CLOSE_ID, IDialogConstants.CLOSE_LABEL, true); setButtons(buttons); } }; int returnValue = dialog.open(); if (restoreId == returnValue || settingsId == returnValue) { if (restoreId == returnValue) { IPreferenceStore store = EDTUIPlugin.getDefault().getPreferenceStore(); store.setToDefault(EDTUIPreferenceConstants.CODEASSIST_CATEGORY_ORDER); store.setToDefault(EDTUIPreferenceConstants.CODEASSIST_EXCLUDED_CATEGORIES); } if (settingsId == returnValue) PreferencesUtil .createPreferenceDialogOn(shell, "org.eclipse.edt.ide.ui.preferences.CodeAssistPreferenceAdvanced", null, null) //$NON-NLS-1$ .open(); fComputerRegistry.reload(); return true; } } return false; }
From source file:org.eclipse.emf.cdo.internal.ui.dialogs.PackageManagerDialog.java
License:Open Source License
@Override protected void createButtonsForButtonBar(Composite parent) { createButton(parent, REGISTER_GENERATED_PACKAGES_ID, "Generated...", false); createButton(parent, REGISTER_WORKSPACE_PACKAGES_ID, "Workspace...", false); createButton(parent, REGISTER_FILESYSTEM_PACKAGES_ID, "Filesystem...", false); createButton(parent, IDialogConstants.CLOSE_ID, IDialogConstants.CLOSE_LABEL, false); }
From source file:org.eclipse.emf.cdo.internal.ui.dialogs.PackageManagerDialog.java
License:Open Source License
@Override protected void buttonPressed(int buttonId) { switch (buttonId) { case REGISTER_GENERATED_PACKAGES_ID: new RegisterGeneratedPackagesAction(page, session) { @Override/*www.j ava 2s .co m*/ protected void postRegistration(List<EPackage> ePackages) { refreshViewer(); } }.run(); break; case REGISTER_WORKSPACE_PACKAGES_ID: new RegisterWorkspacePackagesAction(page, session) { @Override protected void postRegistration(List<EPackage> ePackages) { refreshViewer(); } }.run(); break; case REGISTER_FILESYSTEM_PACKAGES_ID: new RegisterFilesystemPackagesAction(page, session) { @Override protected void postRegistration(List<EPackage> ePackages) { refreshViewer(); } }.run(); break; case IDialogConstants.CLOSE_ID: close(); break; } }
From source file:org.eclipse.gmf.runtime.common.ui.dialogs.PropertiesDialog.java
License:Open Source License
protected void createButtonsForButtonBar(Composite parent) { // create close button closeButton = createButton(parent, IDialogConstants.CLOSE_ID, IDialogConstants.CLOSE_LABEL, true); getShell().setDefaultButton(closeButton); }
From source file:org.eclipse.gmf.runtime.common.ui.dialogs.PropertiesDialog.java
License:Open Source License
protected void buttonPressed(int buttonId) { if (buttonId == IDialogConstants.CLOSE_ID) { close(); return; } }
From source file:org.eclipse.pde.internal.runtime.logview.OpenLogDialog.java
License:Open Source License
protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.CLOSE_ID, IDialogConstants.get().CLOSE_LABEL, true); }
From source file:org.eclipse.scada.configuration.ui.component.ComponentOutputDialog.java
License:Open Source License
@Override protected void createButtonsForButtonBar(final Composite parent) { createButton(parent, IDialogConstants.CLOSE_ID, IDialogConstants.CLOSE_LABEL, true); }
From source file:org.eclipse.scada.da.client.dataitem.details.dialog.DataItemDetailsDialog.java
License:Open Source License
@Override protected void buttonPressed(final int buttonId) { if (buttonId == IDialogConstants.CLOSE_ID) { closePressed();// w w w. j av a 2s. com } }