Java Code Examples for org.eclipse.swt.widgets.Button#getShell()

The following examples show how to use org.eclipse.swt.widgets.Button#getShell() . 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: RouteResourceController.java    From tesb-studio-se with Apache License 2.0 6 votes vote down vote up
/**
 *
 * @param source
 * @return
 */
private PropertyChangeCommand createButtonCommand(Button button) {
    RouteResourceSelectionDialog dialog = new RouteResourceSelectionDialog(button.getShell());

    selectNodeIfExists(button, dialog);

    if (dialog.open() == Window.OK) {

        IRepositoryViewObject repositoryObject = dialog.getResult().getObject();

        // refreshItemeProperty(repositoryObject);

        final Item item = repositoryObject.getProperty().getItem();
        String id = item.getProperty().getId();
        String paramName = (String) button.getData(PARAMETER_NAME);

        return new PropertyChangeCommand(elem, paramName, id);
    }
    return null;
}
 
Example 2
Source File: RouteInputProcessTypeController.java    From tesb-studio-se with Apache License 2.0 5 votes vote down vote up
protected Command createButtonCommand(Button button) {
	AssignJobWizard assignJobWizard = new AssignJobWizard();
	WizardDialog wizardDialog = new AssignJobWizardDialog(button.getShell(), assignJobWizard);
	if (wizardDialog.open() == WizardDialog.OK) {
		String id = assignJobWizard.getSelectedProcessId();
		if(id != null){
			String paramName = (String) button.getData(PARAMETER_NAME);
			return new PropertyChangeCommand(elem, paramName, id);
		}
	}
	return null;
}
 
Example 3
Source File: ControlUtils.java    From goclipse with Eclipse Public License 1.0 5 votes vote down vote up
public static String openProgramPathDialog(IProject project, Button button) throws OperationCancellation {
	ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(
		button.getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider());
	dialog.setTitle(LangUIMessages.ProgramPathDialog_title);
	dialog.setMessage(LangUIMessages.ProgramPathDialog_message);
	
	dialog.setInput(project);
	dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
	if(dialog.open() == IDialogConstants.OK_ID) {
		IResource resource = (IResource) dialog.getFirstResult();
		return resource.getProjectRelativePath().toPortableString();
	}
	throw new OperationCancellation();
}