Java Code Examples for org.eclipse.swt.widgets.Shell#setData()

The following examples show how to use org.eclipse.swt.widgets.Shell#setData() . 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: GroovySourceViewerFactory.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
private void configureContext(Shell shell) {
    final IEclipseContext e4Context = ((Workbench) PlatformUI.getWorkbench()).getContext();
    while (!Objects.equals(e4Context.getActiveLeaf(), e4Context)) {
        e4Context.getActiveLeaf().deactivate();
    }
    final IEclipseContext expressionDialogContext = e4Context.createChild("expressionDialogContext");
    expressionDialogContext.activate();
    shell.setData("org.eclipse.e4.ui.shellContext", expressionDialogContext);
}
 
Example 2
Source File: DarkPanel.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Constructs a new instance of this class given its parent.
 *
 * @param shell a shell that will be the parent of the new instance (cannot
 *            be null)
 * @exception IllegalArgumentException
 *                <ul>
 *                <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
 *                </ul>
 * @exception SWTException
 *                <ul>
 *                <li>ERROR_WIDGET_DISPOSED - if the parent has been
 *                disposed</li>
 *                <li>ERROR_THREAD_INVALID_ACCESS - if not called from the
 *                thread that created the parent</li>
 *                </ul>
 */
public DarkPanel(final Shell shell) {
	if (shell == null) {
		SWT.error(SWT.ERROR_NULL_ARGUMENT);
	}

	if (shell.isDisposed()) {
		SWT.error(SWT.ERROR_INVALID_ARGUMENT);
	}

	parent = shell;
	if (shell.getData(DARK_PANEL_KEY) != null) {
		throw new IllegalArgumentException("This shell has already an infinite panel attached on it !");
	}
	shell.setData(DARK_PANEL_KEY, this);
	alpha = 100;
}
 
Example 3
Source File: BlurredPanel.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Constructs a new instance of this class given its parent.
 *
 * @param shell a shell that will be the parent of the new instance (cannot
 *            be null)
 * @exception IllegalArgumentException
 *                <ul>
 *                <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
 *                </ul>
 * @exception SWTException
 *                <ul>
 *                <li>ERROR_WIDGET_DISPOSED - if the parent has been
 *                disposed</li>
 *                <li>ERROR_THREAD_INVALID_ACCESS - if not called from the
 *                thread that created the parent</li>
 *                </ul>
 */
public BlurredPanel(final Shell shell) {
	if (shell == null) {
		SWT.error(SWT.ERROR_NULL_ARGUMENT);
	}

	if (shell.isDisposed()) {
		SWT.error(SWT.ERROR_INVALID_ARGUMENT);
	}

	parent = shell;
	if (shell.getData(BLURED_PANEL_KEY) != null) {
		throw new IllegalArgumentException("This shell has already an infinite panel attached on it !");
	}
	shell.setData(BLURED_PANEL_KEY, this);
	radius = 2;
}
 
Example 4
Source File: BonitaContentProposalAdapter.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void configureShell(final Shell shell) {
    super.configureShell(shell);
    shell.setData(SWTBOT_WIDGET_ID_KEY, SWTBOT_ID_EXPRESSIONVIEWER_PROPOSAL_SHELL);
}