List of usage examples for org.eclipse.jface.dialogs IDialogConstants BACK_ID
int BACK_ID
To view the source code for org.eclipse.jface.dialogs IDialogConstants BACK_ID.
Click Source Link
From source file:com.predic8.plugin.membrane.dialogs.rule.AbstractProxyConfigurationEditDialog.java
License:Apache License
@Override protected void createButtonsForButtonBar(Composite parent) { createButton(parent, IDialogConstants.BACK_ID, "Reset", false); createButton(parent, IDialogConstants.OK_ID, "OK", false); createButton(parent, IDialogConstants.CANCEL_ID, "Cancel", true); }
From source file:com.predic8.plugin.membrane.dialogs.rule.AbstractProxyConfigurationEditDialog.java
License:Apache License
@Override protected void buttonPressed(int buttonId) { if (buttonId == IDialogConstants.BACK_ID) { setInput(rule);//from w ww . j a v a 2 s .com } super.buttonPressed(buttonId); }
From source file:com.tocea.scertify.eclipse.scertifycode.ui.stats.views.internal.ScertifyMarkerFilterDialog.java
License:Open Source License
/** * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite) *//*from w w w . j a va 2 s . com*/ protected void createButtonsForButtonBar(Composite parent) { this.mBtnDefault = this.createButton(parent, IDialogConstants.BACK_ID, Messages.ScertifyMarkerFilterDialog_btnRestoreDefault, false); this.mBtnDefault.addSelectionListener(this.mController); // create OK and Cancel buttons by default this.createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); this.createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); }
From source file:dynamicrefactoring.interfaz.wizard.CustomWizardDialog.java
License:Open Source License
/** * Crea los botones del dilogo en que se muestra un asistente. * /*from www . jav a 2s . c o m*/ * @param parent el componente padre que contendr los botones. */ @Override protected void createButtonsForButtonBar(Composite parent) { super.createButtonsForButtonBar(parent); if (super.getButton(IDialogConstants.FINISH_ID) != null) super.getButton(IDialogConstants.FINISH_ID).setText(ButtonTextProvider.getFinishText()); if (super.getButton(IDialogConstants.CANCEL_ID) != null) super.getButton(IDialogConstants.CANCEL_ID).setText(ButtonTextProvider.getCancelText()); if (super.getButton(IDialogConstants.BACK_ID) != null) super.getButton(IDialogConstants.BACK_ID).setText(ButtonTextProvider.getBackText()); if (super.getButton(IDialogConstants.NEXT_ID) != null) super.getButton(IDialogConstants.NEXT_ID).setText(ButtonTextProvider.getNextText()); }
From source file:es.axios.udig.ui.commons.util.DialogUtil.java
License:LGPL
public static ProgressMonitorDialog openProgressMonitorDialog(final Shell shell, final String dialogTitle, final boolean showRunInBackground, final boolean confirmCancelRequests) { ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell) { @Override/*from w w w . ja v a2 s . co m*/ protected void cancelPressed() { boolean confirmed = true; if (confirmCancelRequests) { String title = Messages.DialogUtil_title; String message = Messages.DialogUtil_message; confirmed = DialogUtil.openQuestion(title, message); } if (confirmed) { super.cancelPressed(); } } @Override protected void configureShell(Shell shell) { super.configureShell(shell); shell.setText(dialogTitle); } @Override protected void createButtonsForButtonBar(Composite parent) { if (showRunInBackground) createBackgroundButton(parent); super.createButtonsForButtonBar(parent); } private void createBackgroundButton(Composite parent) { createButton(parent, IDialogConstants.BACK_ID, Messages.DialogUtil_runInBackground, true); } @Override protected void buttonPressed(int buttonId) { if (buttonId == IDialogConstants.BACK_ID) { getShell().setVisible(false); } else super.buttonPressed(buttonId); } }; return dialog; }
From source file:es.cv.gvcase.ide.navigator.dialogs.NavigatorSearchDialog.java
License:Open Source License
@Override protected void createButtonsForButtonBar(Composite parent) { backButton = createButton(parent, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, false); backButton.setEnabled(false);/*from www.j a v a2s. c o m*/ backButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { ISelection sel = viewer.getSelection(); if (!(sel instanceof StructuredSelection)) { return; } StructuredSelection ssel = (StructuredSelection) sel; int index = matchedObjects.lastIndexOf(ssel.getFirstElement()); if (index == 0) { index = matchedObjects.size() - 1; } index--; if (index < 0) { index = 0; } StructuredSelection ss = new StructuredSelection(matchedObjects.get(index)); viewer.setSelection(ss, true); } }); nextButton = createButton(parent, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, false); nextButton.setEnabled(false); nextButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { ISelection sel = viewer.getSelection(); if (!(sel instanceof StructuredSelection)) { return; } StructuredSelection ssel = (StructuredSelection) sel; int index = matchedObjects.lastIndexOf(ssel.getFirstElement()); if (index == matchedObjects.size() - 1) { index = -1; } index++; StructuredSelection ss = new StructuredSelection(matchedObjects.get(index)); viewer.setSelection(ss, true); } }); createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false); }
From source file:eu.numberfour.n4js.ui.organize.imports.MultiElementListSelectionDialog.java
License:Open Source License
@Override protected void createButtonsForButtonBar(Composite parent) { fBackButton = createButton(parent, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, false); // XXX: Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=279425 boolean HAS_BUG_279425 = true; fNextButton = createButton(parent, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, !HAS_BUG_279425); fFinishButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.FINISH_LABEL, HAS_BUG_279425); createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); }
From source file:kr.co.apexsoft.stella.modeler.explorer.dialog.ApexNavigatorSearchDialog.java
License:Open Source License
@Override protected void createButtonsForButtonBar(Composite parent) { backButton = createButton(parent, IDialogConstants.BACK_ID, IDialogConstants.BACK_LABEL, false); nextButton = createButton(parent, IDialogConstants.NEXT_ID, IDialogConstants.NEXT_LABEL, false); createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); backButton.setEnabled(false);/*from w w w. j a va 2s. com*/ nextButton.setEnabled(false); nextButton.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { } public void widgetSelected(SelectionEvent e) { if (currentIndex >= matchedObjects.size() - 1) { currentIndex = 0; } else { currentIndex++; } fireSetSelection(new StructuredSelection(matchedObjects.get(currentIndex)), true); } }); backButton.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { } public void widgetSelected(SelectionEvent e) { if (currentIndex <= 0) { currentIndex = matchedObjects.size() - 1; } else { currentIndex--; } fireSetSelection(new StructuredSelection(matchedObjects.get(currentIndex)), true); } }); }
From source file:net.geoprism.shapefile.LocalizedWizardDialog.java
License:Open Source License
/** * Creates the Previous and Next buttons for this wizard dialog. Creates * standard (<code>SWT.PUSH</code>) buttons and registers for their selection * events. Note that the number of columns in the button bar composite is * incremented. These buttons are created specially to prevent any space * between them./*from w ww .j a v a 2 s. co m*/ * * @param parent * the parent button bar * @return a composite containing the new buttons */ private Composite createPreviousAndNextButtons(Composite parent) { // increment the number of columns in the button bar ((GridLayout) parent.getLayout()).numColumns++; Composite composite = new Composite(parent, SWT.NONE); // create a layout with spacing and margins appropriate for the font // size. GridLayout layout = new GridLayout(); layout.numColumns = 0; // will be incremented by createButton layout.marginWidth = 0; layout.marginHeight = 0; layout.horizontalSpacing = 0; layout.verticalSpacing = 0; composite.setLayout(layout); GridData data = new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_CENTER); composite.setLayoutData(data); composite.setFont(parent.getFont()); backButton = createButton(composite, IDialogConstants.BACK_ID, Localizer.getMessage("BACK"), false); nextButton = createButton(composite, IDialogConstants.NEXT_ID, Localizer.getMessage("NEXT"), false); return composite; }
From source file:net.heartsome.license.LicenseManageDialog.java
License:Open Source License
@Override protected void createButtonsForButtonBar(Composite parent) { if (isShowBack) { Button backBtn = createButton(parent, IDialogConstants.BACK_ID, Messages.getString("license.OfflineActiveDialog.backBtn"), false); backBtn.addSelectionListener(new SelectionAdapter() { @Override/*from www . j a va 2 s.com*/ public void widgetSelected(SelectionEvent e) { setReturnCode(OK); Point p = getShell().getLocation(); close(); ActiveMethodDialog dialog = new ActiveMethodDialog(getShell(), p); dialog.open(); } }); } Button button = createButton(parent, 11, Messages.getString("license.LicenseManageDialog.netconnection"), false); button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); PreferenceManager mgr = window.getWorkbench().getPreferenceManager(); IPreferenceNode node = null; @SuppressWarnings("unchecked") List<IPreferenceNode> lstNodes = mgr.getElements(PreferenceManager.PRE_ORDER); for (IPreferenceNode n : lstNodes) { if (n.getId().equals("org.eclipse.ui.net.proxy_preference_page_context")) { node = n; } } if (node == null) { return; } mgr = new PreferenceManager(); mgr.addToRoot(node); HsPreferenceDialog dlg = new HsPreferenceDialog(window.getShell(), mgr); dlg.create(); final List<Image> imageList = new ArrayList<Image>(); dlg.getTreeViewer().setLabelProvider(new PreferenceLabelProvider() { Image image = null; public Image getImage(Object element) { String id = ((IPreferenceNode) element).getId(); if ("org.eclipse.ui.net.proxy_preference_page_context".equals(id)) { // image = Activator.getImageDescriptor("icons/network.png").createImage(); imageList.add(image); return image; } else { return null; } } }); dlg.open(); for (Image img : imageList) { if (img != null && !img.isDisposed()) { img.dispose(); } } imageList.clear(); } }); boolean isDefault = false; if (type == Constants.STATE_NOT_ACTIVATED || type == Constants.STATE_INVALID || type == Constants.STATE_EXPIRED || type == Constants.EXCEPTION_INT14 || type == Constants.EXCEPTION_INT15 || type == Constants.EXCEPTION_INT1 || type == Constants.EXCEPTION_INT2 || type == Constants.EXCEPTION_INT3 || type == Constants.EXCEPTION_INT4) { createButton(parent, IDialogConstants.OK_ID, Messages.getString("license.LicenseManageDialog.activeBtn"), true); isDefault = true; } createButton(parent, IDialogConstants.CANCEL_ID, Messages.getString("license.LicenseManageDialog.exitBtn"), !isDefault).setFocus(); }