Java Code Examples for org.eclipse.jface.dialogs.IDialogConstants#DETAILS_ID

The following examples show how to use org.eclipse.jface.dialogs.IDialogConstants#DETAILS_ID . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EnableChannelDialog.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected void buttonPressed(int buttonId) {
    if (buttonId == IDialogConstants.DETAILS_ID) {
        setDefaults();
        return;
    }
    super.buttonPressed(buttonId);
}
 
Example 2
Source File: AbstractDetailsDialog.java    From gama with GNU General Public License v3.0 5 votes vote down vote up
/**
 * The buttonPressed() method is called when either the OK or Details buttons is pressed. We override this method to
 * alternately show or hide the details area if the Details button is pressed.
 *
 * @param id
 *            the id
 */
@Override
protected void buttonPressed(final int id) {
	if (id == IDialogConstants.DETAILS_ID) {
		toggleDetailsArea();
	} else {
		super.buttonPressed(id);
	}
}
 
Example 3
Source File: DetailsDialog.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
protected void buttonPressed(int id) {
	if (id == IDialogConstants.DETAILS_ID) {  // was the details button pressed?
		toggleDetailsArea();
	} else {
		super.buttonPressed(id);
	} 
}
 
Example 4
Source File: ExceptionDialog.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
protected void buttonPressed(int id) {
	if (id == IDialogConstants.DETAILS_ID) {
		// was the details button pressed?
		toggleDetailsArea();
	}
	else {
		super.buttonPressed(id);
	}
}
 
Example 5
Source File: ExceptionDialog.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
protected void buttonPressed( int id )
{
	if ( id == IDialogConstants.DETAILS_ID )
	{
		// was the details button pressed?
		toggleDetailsArea( );
	}
	else
	{
		super.buttonPressed( id );
	}
}
 
Example 6
Source File: BonitaErrorDialog.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
   protected void buttonPressed(final int id) {
	if (id == IDialogConstants.DETAILS_ID) {
		// was the details button pressed?
		toggleDetailsArea();
	} else {
		super.buttonPressed(id);
	}
}
 
Example 7
Source File: DetailsDialog.java    From jbt with Apache License 2.0 4 votes vote down vote up
protected void buttonPressed(int buttonId) {
	if (buttonId == IDialogConstants.DETAILS_ID) {
		/*
		 * If the details button has been pressed, then the details area
		 * must be shown or hidden, depending on whether it as hidden or
		 * not. After doing so, the dialog must be resized.
		 */
		Point dialogOldDimensions = getShell().getSize();
		if (this.detailsTextCreated) {
			/*
			 * If the details area is being showed, we delete it. Also, the
			 * label on the details button must be changed.
			 */
			this.detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
			this.detailsText.dispose();
		}
		else {
			/*
			 * If the text area is not being showed, it must be created and
			 * showed. In order to do so, we initialize "this.detailsText".
			 * Also, the label on the details button must be changed.
			 */
			this.detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
			this.detailsText = new Text((Composite) getContents(), SWT.BORDER | SWT.READ_ONLY
					| SWT.MULTI | SWT.WRAP | SWT.H_SCROLL | SWT.V_SCROLL);
			this.detailsText.setText(this.details);
			GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
			this.detailsText
					.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
			data.horizontalSpan = 2;
			this.detailsText.setLayoutData(data);
		}
		getContents().getShell().layout();
		this.detailsTextCreated = !this.detailsTextCreated;

		/*
		 * The dialog is finalli resized.
		 */
		Point dialogNewDimensions = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
		int screenHeight = Display.getCurrent().getClientArea().height;
		getShell()
				.setSize(
						new Point(dialogOldDimensions.x, Math.min(dialogNewDimensions.y,
								screenHeight)));
	}
	else {
		/*
		 * Close the dialog...
		 */
		close();
	}
	setReturnCode(buttonId);
}