List of usage examples for org.eclipse.jface.dialogs IDialogConstants SHOW_DETAILS_LABEL
String SHOW_DETAILS_LABEL
To view the source code for org.eclipse.jface.dialogs IDialogConstants SHOW_DETAILS_LABEL.
Click Source Link
From source file:org.eclipse.gmf.internal.codegen.popup.actions.DiagnosticsDialog.java
License:Open Source License
/** * Toggles the unfolding of the details area. This is triggered by the user * pressing the details button.//w w w . j av a 2 s . c om */ private void toggleDetailsArea() { Point windowSize = getShell().getSize(); Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); if (detailsCreated) { diagnosticTree.getTree().dispose(); stackTraceText.dispose(); detailsCreated = false; detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL); } else { createDetailsArea((Composite) getContents()); detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL); } Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); getShell().setSize(new Point(windowSize.x, windowSize.y + (newSize.y - oldSize.y))); }
From source file:org.eclipse.jst.j2ee.internal.plugin.ErrorDialog.java
License:Open Source License
/** * Toggles the unfolding of the details area. This is triggered by the user pressing the details * button./*from w w w . j a v a2 s . co m*/ */ private void toggleDetailsArea() { Point windowSize = getShell().getSize(); Point oldSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT); if (text != null) { text.dispose(); text = null; getButton(detailButtonID).setText(IDialogConstants.SHOW_DETAILS_LABEL); } else { createDropDownText((Composite) getContents()); getButton(detailButtonID).setText(IDialogConstants.HIDE_DETAILS_LABEL); } Point newSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT); getShell().setSize(new Point(windowSize.x, windowSize.y + (newSize.y - oldSize.y))); }
From source file:org.eclipse.mat.ui.snapshot.RuntimeListDialog.java
License:Open Source License
@Override protected void createButtonsForButtonBar(Composite parent) { detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, IDialogConstants.SHOW_DETAILS_LABEL, true);/*from w w w. ja v a 2s .c o m*/ super.createButtonsForButtonBar(parent); }
From source file:org.eclipse.mat.ui.snapshot.RuntimeListDialog.java
License:Open Source License
@Override protected void buttonPressed(int buttonId) { if (buttonId == IDialogConstants.DETAILS_ID) { if (detailsButton.getText().equals(IDialogConstants.SHOW_DETAILS_LABEL)) { detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL); Object selection = ((IStructuredSelection) getTableViewer().getSelection()).getFirstElement(); if (selection instanceof MultipleSnapshotsException.Context) { updateDetails((MultipleSnapshotsException.Context) selection); }//from w w w. j a v a 2s . c o m } else { detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL); updateDetails(null); } } else { super.buttonPressed(buttonId); } }
From source file:org.eclipse.oomph.setup.internal.installer.InstallerApplication.java
License:Open Source License
public Object start(IApplicationContext context) throws Exception { try {//from w w w . ja va2 s.c o m return run(context); } catch (Throwable t) { SetupInstallerPlugin.INSTANCE.log(t); final AtomicInteger exitCode = new AtomicInteger(EXIT_ERROR); ErrorDialog dialog = new ErrorDialog("Error", t, 0, 2, IDialogConstants.OK_LABEL, "Update", IDialogConstants.SHOW_DETAILS_LABEL) { @Override protected void buttonPressed(int buttonId) { super.buttonPressed(buttonId); if (buttonId == 1) { update(); } } private void update() { try { final Shell shell = getShell(); if (!MessageDialog.openQuestion(shell, "Emergency Update", "This is an emergency update. Continue?\n\n" + "To lower the risk of problems during this update it will be implied that you accept new licenses or unsigned content.")) { return; } ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell) { @Override protected Point getInitialSize() { Point calculatedSize = super.getInitialSize(); if (calculatedSize.x < 800) { calculatedSize.x = 800; } return calculatedSize; } }; try { dialog.run(true, true, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { SubMonitor progress = SubMonitor.convert(monitor, 2); try { Resolution resolution = SelfUpdate.resolve(null, progress.newChild(1)); if (resolution == null) { UIUtil.syncExec(new Runnable() { public void run() { MessageDialog.openInformation(shell, "Update", "No updates were found."); } }); return; } resolution.commit(progress.newChild(1)); exitCode.set(EXIT_RESTART); } catch (Throwable ex) { throw new InvocationTargetException(ex); } finally { progress.done(); } } }); } catch (OperationCanceledException ex) { //$FALL-THROUGH$ } catch (InvocationTargetException ex) { if (!(ex.getCause() instanceof OperationCanceledException)) { throw ex; } } } catch (Throwable ex) { SetupInstallerPlugin.INSTANCE.log(ex); ErrorDialog.open(ex); } } }; dialog.open(); return exitCode.get(); } }
From source file:org.eclipse.oomph.ui.ErrorDialog.java
License:Open Source License
private ErrorDialog(String title, Throwable throwable) { this(title, throwable, 0, 1, IDialogConstants.OK_LABEL, IDialogConstants.SHOW_DETAILS_LABEL); }
From source file:org.eclipse.oomph.ui.ErrorDialog.java
License:Open Source License
private void toggleDetailsArea() { Point windowSize = getShell().getSize(); Point oldSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT); if (text != null) { text.dispose();/*from w w w . java2 s . c o m*/ text = null; getButton(detailsButtonID).setText(IDialogConstants.SHOW_DETAILS_LABEL); } else { createDropDownText((Composite) getContents()); getButton(detailsButtonID).setText(IDialogConstants.HIDE_DETAILS_LABEL); } Point newSize = getContents().computeSize(SWT.DEFAULT, SWT.DEFAULT); getShell().setSize(new Point(windowSize.x, windowSize.y + newSize.y - oldSize.y)); }
From source file:org.eclipse.sirius.common.ui.tools.api.dialog.SiriusMessageDialogWithToggle.java
License:Open Source License
/** * Attempt to find a standard JFace button id that matches the specified * button label. If no match can be found, use the default id provided. * /*from ww w . jav a 2s .co m*/ * Overridden to investigate the provided buttons. * * @param buttonLabel * the button label whose id is sought * @param defaultId * the id to use for the button if there is no standard id * @return the id for the specified button label */ // CHECKSTYLE:OFF private int mapButtonLabelToButtonID(String buttonLabel, int defaultId) { // CHECKSTYLE:OON // Not pretty but does the job... if (IDialogConstants.OK_LABEL.equals(buttonLabel)) { return IDialogConstants.OK_ID; } if (IDialogConstants.YES_LABEL.equals(buttonLabel)) { return IDialogConstants.YES_ID; } if (IDialogConstants.NO_LABEL.equals(buttonLabel)) { return IDialogConstants.NO_ID; } if (IDialogConstants.CANCEL_LABEL.equals(buttonLabel)) { return IDialogConstants.CANCEL_ID; } if (IDialogConstants.YES_TO_ALL_LABEL.equals(buttonLabel)) { return IDialogConstants.YES_TO_ALL_ID; } if (IDialogConstants.SKIP_LABEL.equals(buttonLabel)) { return IDialogConstants.SKIP_ID; } if (IDialogConstants.STOP_LABEL.equals(buttonLabel)) { return IDialogConstants.STOP_ID; } if (IDialogConstants.ABORT_LABEL.equals(buttonLabel)) { return IDialogConstants.ABORT_ID; } if (IDialogConstants.RETRY_LABEL.equals(buttonLabel)) { return IDialogConstants.RETRY_ID; } if (IDialogConstants.IGNORE_LABEL.equals(buttonLabel)) { return IDialogConstants.IGNORE_ID; } if (IDialogConstants.PROCEED_LABEL.equals(buttonLabel)) { return IDialogConstants.PROCEED_ID; } if (IDialogConstants.OPEN_LABEL.equals(buttonLabel)) { return IDialogConstants.OPEN_ID; } if (IDialogConstants.CLOSE_LABEL.equals(buttonLabel)) { return IDialogConstants.CLOSE_ID; } if (IDialogConstants.BACK_LABEL.equals(buttonLabel)) { return IDialogConstants.BACK_ID; } if (IDialogConstants.NEXT_LABEL.equals(buttonLabel)) { return IDialogConstants.NEXT_ID; } if (IDialogConstants.FINISH_LABEL.equals(buttonLabel)) { return IDialogConstants.FINISH_ID; } if (IDialogConstants.HELP_LABEL.equals(buttonLabel)) { return IDialogConstants.HELP_ID; } if (IDialogConstants.NO_TO_ALL_LABEL.equals(buttonLabel)) { return IDialogConstants.NO_TO_ALL_ID; } if (IDialogConstants.SHOW_DETAILS_LABEL.equals(buttonLabel)) { return IDialogConstants.DETAILS_ID; } if (IDialogConstants.HIDE_DETAILS_LABEL.equals(buttonLabel)) { return IDialogConstants.DETAILS_ID; } for (String providedButton : buttonsMap.keySet()) { if (providedButton.equals(buttonLabel)) { return buttonsMap.get(providedButton); } } // No XXX_LABEL in IDialogConstants for these. Unlikely // they would be used in a message dialog though. // public int SELECT_ALL_ID = 18; // public int DESELECT_ALL_ID = 19; // public int SELECT_TYPES_ID = 20; return defaultId; }
From source file:org.eclipse.team.internal.ui.dialogs.DetailsDialog.java
License:Open Source License
protected String getDetailsButtonLabelShow() { return IDialogConstants.SHOW_DETAILS_LABEL; }
From source file:org.eclipse.team.svn.ui.panel.AbstractAdvancedDialogPanel.java
License:Open Source License
public AbstractAdvancedDialogPanel() { this(new String[] { IDialogConstants.OK_LABEL, IDialogConstants.CANCEL_LABEL }, new String[] { IDialogConstants.SHOW_DETAILS_LABEL }); }