List of usage examples for org.eclipse.jface.dialogs IDialogConstants DETAILS_ID
int DETAILS_ID
To view the source code for org.eclipse.jface.dialogs IDialogConstants DETAILS_ID.
Click Source Link
From source file:org.eclipse.linuxtools.internal.lttng2.control.ui.views.dialogs.EnableChannelDialog.java
License:Open Source License
@Override protected void buttonPressed(int buttonId) { if (buttonId == IDialogConstants.DETAILS_ID) { setDefaults();//from ww w . j a v a 2 s. c o m return; } super.buttonPressed(buttonId); }
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. j ava 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 ww. j a va 2 s. c o m*/ } else { detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL); updateDetails(null); } } else { super.buttonPressed(buttonId); } }
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. j ava 2 s. c o 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 void buttonPressed(int id) { if (id == IDialogConstants.DETAILS_ID) { // was the details button pressed? toggleDetailsArea();// ww w. ja v a 2 s.c o m } else { super.buttonPressed(id); } }
From source file:org.eclipse.team.internal.ui.dialogs.DetailsDialog.java
License:Open Source License
protected void createButtonsForButtonBar(Composite parent) { // create OK and Details buttons if (includeOkButton()) { okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); }// w ww. j a va 2 s . c o m if (includeCancelButton()) { createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); } if (includeDetailsButton()) { detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, getDetailsButtonLabelShow(), false); } updateEnablements(); }
From source file:org.eclipse.ui.internal.activities.ws.EnablementDialog.java
License:Open Source License
protected void createButtonsForButtonBar(Composite parent) { super.createButtonsForButtonBar(parent); detailsButton = createButton(parent, IDialogConstants.DETAILS_ID, "", false); //$NON-NLS-1$ setDetailButtonLabel();//from w w w .ja v a 2 s . c om }
From source file:org.eclipse.ui.internal.activities.ws.EnablementDialog.java
License:Open Source License
protected void buttonPressed(int buttonId) { if (buttonId == IDialogConstants.DETAILS_ID) { detailsPressed();// w w w . j a v a 2 s .c o m return; } super.buttonPressed(buttonId); }
From source file:org.eclipse.ui.internal.statushandlers.InternalDialog.java
License:Open Source License
protected void buttonPressed(int id) { if (id == GOTO_ACTION_ID) { IAction gotoAction = getGotoAction(); if (gotoAction != null) { if (isPromptToClose()) { okPressed(); // close the dialog gotoAction.run(); // run the goto action }/*from ww w. ja v a 2 s. c om*/ } } if (id == IDialogConstants.DETAILS_ID) { // was the details button pressed? dialogState.put(IStatusDialogConstants.DETAILS_OPENED, new Boolean(toggleDetailsArea())); } else { super.buttonPressed(id); } }
From source file:org.eclipse.ui.internal.statushandlers.InternalDialog.java
License:Open Source License
/** * Toggles the unfolding of the details area. This is triggered by the * user pressing the details button.//from w ww. jav a2s. co m * */ private boolean toggleDetailsArea() { boolean opened = false; Point windowSize = getShell().getSize(); if (detailsManager.isOpen()) { detailsManager.close(); getButton(IDialogConstants.DETAILS_ID).setText(IDialogConstants.SHOW_DETAILS_LABEL); opened = false; } else { detailsManager.createDetailsArea(dialogArea, getCurrentStatusAdapter()); getButton(IDialogConstants.DETAILS_ID).setText(IDialogConstants.HIDE_DETAILS_LABEL); opened = true; } GridData listAreaGridData = (GridData) listArea.getLayoutData(); // if there is only one status to display, // make sure that the list area is as small as possible if (!isMulti()) { listAreaGridData.heightHint = 0; } // allow listArea to grab space depending if details // are opened or not if (opened) { listAreaGridData.grabExcessVerticalSpace = false; } else { listAreaGridData.grabExcessVerticalSpace = true; } listArea.setLayoutData(listAreaGridData); Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); int diffY = newSize.y - windowSize.y; // increase the dialog height if details were opened and such // increase is necessary // decrease the dialog height if details were closed and empty space // appeared if ((opened && diffY > 0) || (!opened && diffY < 0)) { getShell().setSize(new Point(windowSize.x, windowSize.y + (diffY))); } dialogArea.layout(); return opened; }