Java Code Examples for org.eclipse.jface.wizard.WizardDialog.setMinimumPageSize()

The following are Jave code examples for showing how to use setMinimumPageSize() of the org.eclipse.jface.wizard.WizardDialog class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: subclipse   File: GenerateDiffFileAction.java   View Source Code Vote up 5 votes
/** (Non-javadoc)
 * Method declared on IActionDelegate.
 * @throws InterruptedException 
 * @throws InvocationTargetException 
 */
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
	statusMap = new HashMap();
	unaddedList = new ArrayList();
	String title = Policy.bind("GenerateSVNDiff.title"); //$NON-NLS-1$
	final IResource[] resources = getSelectedResources();
	run(new IRunnableWithProgress() {
		public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
			 try {
				modifiedResources = getModifiedResources(resources, monitor);
			} catch (SVNException e) {
				SVNUIPlugin.log(IStatus.ERROR, e.getMessage(), e);
			}		
		}
		
	}, true, PROGRESS_BUSYCURSOR);
	if (modifiedResources == null || modifiedResources.length == 0) {
		MessageDialog.openInformation(getShell(), Policy.bind("GenerateSVNDiff.title"), Policy.bind("GenerateSVNDiff.noDiffsFoundMsg")); //$NON-NLS-1$ //$NON-NLS-1$
		return;
	}
	IResource[] unaddedResources = new IResource[unaddedList.size()];
	unaddedList.toArray(unaddedResources);
	GenerateDiffFileWizard wizard = new GenerateDiffFileWizard(new StructuredSelection(modifiedResources), unaddedResources, statusMap);
	wizard.setWindowTitle(title);
	wizard.setSelectedResources(getSelectedResources());
	WizardDialog dialog = new WizardDialogWithPersistedLocation(getShell(), wizard, "GenerateDiffFileWizard"); //$NON-NLS-1$
	dialog.setMinimumPageSize(350, 250);
	dialog.open();
}
 
Example 2
Project: gwt-eclipse-plugin   File: AbstractOpenWizardAction.java   View Source Code Vote up 5 votes
@Override
public void run() {
  Shell localShell = getShell();
  if (!doCreateProjectFirstOnEmptyWorkspace(localShell)) {
    return;
  }

  try {
    INewWizard wizard = createWizard();
    wizard.init(PlatformUI.getWorkbench(), getSelection());

    WizardDialog dialog = new WizardDialog(localShell, wizard);
    IPixelConverter converter =
        PixelConverterFactory.createPixelConverter(JFaceResources.getDialogFont());
    dialog.setMinimumPageSize(converter.convertWidthInCharsToPixels(70),
        converter.convertHeightInCharsToPixels(20));
    dialog.create();
    int res = dialog.open();
    if (res == Window.OK && wizard instanceof NewElementWizard) {
      createdElement = ((NewElementWizard) wizard).getCreatedElement();
    }

    notifyResult(res == Window.OK);
  } catch (CoreException e) {
    String title = NewWizardMessages.AbstractOpenWizardAction_createerror_title;
    String message = NewWizardMessages.AbstractOpenWizardAction_createerror_message;
    ExceptionHandler.handle(e, localShell, title, message);
  }
}
 
Example 3
Project: APICloud-Studio   File: GenerateDiffFileAction.java   View Source Code Vote up 5 votes
/** (Non-javadoc)
 * Method declared on IActionDelegate.
 * @throws InterruptedException 
 * @throws InvocationTargetException 
 */
public void execute(IAction action) throws InvocationTargetException, InterruptedException {
	statusMap = new HashMap();
	unaddedList = new ArrayList();
	String title = Policy.bind("GenerateSVNDiff.title"); //$NON-NLS-1$
	final IResource[] resources = getSelectedResources();
	run(new IRunnableWithProgress() {
		public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
			 try {
				modifiedResources = getModifiedResources(resources, monitor);
			} catch (SVNException e) {
				SVNUIPlugin.log(IStatus.ERROR, e.getMessage(), e);
			}		
		}
		
	}, true, PROGRESS_BUSYCURSOR);
	if (modifiedResources == null || modifiedResources.length == 0) {
		MessageDialog.openInformation(getShell(), Policy.bind("GenerateSVNDiff.title"), Policy.bind("GenerateSVNDiff.noDiffsFoundMsg")); //$NON-NLS-1$ //$NON-NLS-1$
		return;
	}
	IResource[] unaddedResources = new IResource[unaddedList.size()];
	unaddedList.toArray(unaddedResources);
	GenerateDiffFileWizard wizard = new GenerateDiffFileWizard(new StructuredSelection(modifiedResources), unaddedResources, statusMap);
	wizard.setWindowTitle(title);
	wizard.setSelectedResources(getSelectedResources());
	WizardDialog dialog = new WizardDialogWithPersistedLocation(getShell(), wizard, "GenerateDiffFileWizard"); //$NON-NLS-1$
	dialog.setMinimumPageSize(350, 250);
	dialog.open();
}
 
Example 4
Project: subclipse   File: GenerateDiffFileSynchronizeOperation.java   View Source Code Vote up 4 votes
protected void run(SVNTeamProvider provider, SyncInfoSet set, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
		IResource[] resources = set.getResources();
		HashMap statusMap = new HashMap();
		unaddedList = new ArrayList();
		for (int i = 0; i < resources.length; i++) {
			ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resources[i]);
			SyncInfo syncInfo = set.getSyncInfo(resources[i]);
			SVNStatusKind statusKind = null;
			try {
				if (!svnResource.isManaged()) {
					statusKind = SVNStatusKind.UNVERSIONED;
				} else {
					switch (SyncInfo.getChange(syncInfo.getKind())) {
					case SyncInfo.ADDITION:
						statusKind = SVNStatusKind.ADDED;
						break;
					case SyncInfo.DELETION:
						statusKind = SVNStatusKind.DELETED;
						break;
					case SyncInfo.CONFLICTING:
						statusKind = SVNStatusKind.CONFLICTED;
						break;				
					default:
						statusKind = SVNStatusKind.MODIFIED;
						break;
					}
				}
				statusMap.put(resources[i], statusKind);				
				if (!svnResource.isManaged() && !svnResource.isIgnored())
					unaddedList.add(resources[i]);
			} catch (SVNException e) {
				SVNUIPlugin.log(IStatus.ERROR, e.getMessage(), e);
			}
		}
		ArrayList dedupedList = new ArrayList();
		Iterator iter = unaddedList.iterator();
		while (iter.hasNext()) {
			IResource resource = (IResource)iter.next();
			if (!isDupe(resource)) dedupedList.add(resource);
		}
		
		IResource[] unversionedResources = new IResource[dedupedList.size()];
		dedupedList.toArray(unversionedResources);
		GenerateDiffFileWizard wizard = new GenerateDiffFileWizard(new StructuredSelection(resources), unversionedResources, statusMap);
		wizard.setWindowTitle(Policy.bind("GenerateSVNDiff.title")); //$NON-NLS-1$
		wizard.setSelectedResources(selectedResources);
//		final WizardDialog dialog = new WizardDialog(getShell(), wizard);
//		dialog.setMinimumPageSize(350, 250);
		final WizardDialog dialog = new WizardDialogWithPersistedLocation(getShell(), wizard, "GenerateDiffFileWizard"); //$NON-NLS-1$
		dialog.setMinimumPageSize(350, 250);
		getShell().getDisplay().syncExec(new Runnable() {
			public void run() {
				dialog.open();	
			}
		});		
	}
 
Example 5
Project: APICloud-Studio   File: GenerateDiffFileSynchronizeOperation.java   View Source Code Vote up 4 votes
protected void run(SVNTeamProvider provider, SyncInfoSet set, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
		IResource[] resources = set.getResources();
		HashMap statusMap = new HashMap();
		unaddedList = new ArrayList();
		for (int i = 0; i < resources.length; i++) {
			ISVNLocalResource svnResource = SVNWorkspaceRoot.getSVNResourceFor(resources[i]);
			SyncInfo syncInfo = set.getSyncInfo(resources[i]);
			SVNStatusKind statusKind = null;
			try {
				if (!svnResource.isManaged()) {
					statusKind = SVNStatusKind.UNVERSIONED;
				} else {
					switch (SyncInfo.getChange(syncInfo.getKind())) {
					case SyncInfo.ADDITION:
						statusKind = SVNStatusKind.ADDED;
						break;
					case SyncInfo.DELETION:
						statusKind = SVNStatusKind.DELETED;
						break;
					case SyncInfo.CONFLICTING:
						statusKind = SVNStatusKind.CONFLICTED;
						break;				
					default:
						statusKind = SVNStatusKind.MODIFIED;
						break;
					}
				}
				statusMap.put(resources[i], statusKind);				
				if (!svnResource.isManaged() && !svnResource.isIgnored())
					unaddedList.add(resources[i]);
			} catch (SVNException e) {
				SVNUIPlugin.log(IStatus.ERROR, e.getMessage(), e);
			}
		}
		ArrayList dedupedList = new ArrayList();
		Iterator iter = unaddedList.iterator();
		while (iter.hasNext()) {
			IResource resource = (IResource)iter.next();
			if (!isDupe(resource)) dedupedList.add(resource);
		}
		
		IResource[] unversionedResources = new IResource[dedupedList.size()];
		dedupedList.toArray(unversionedResources);
		GenerateDiffFileWizard wizard = new GenerateDiffFileWizard(new StructuredSelection(resources), unversionedResources, statusMap);
		wizard.setWindowTitle(Policy.bind("GenerateSVNDiff.title")); //$NON-NLS-1$
		wizard.setSelectedResources(selectedResources);
//		final WizardDialog dialog = new WizardDialog(getShell(), wizard);
//		dialog.setMinimumPageSize(350, 250);
		final WizardDialog dialog = new WizardDialogWithPersistedLocation(getShell(), wizard, "GenerateDiffFileWizard"); //$NON-NLS-1$
		dialog.setMinimumPageSize(350, 250);
		getShell().getDisplay().syncExec(new Runnable() {
			public void run() {
				dialog.open();	
			}
		});		
	}
 
Example 6
Project: lider-ahenk-installer   File: GUIHelper.java   View Source Code Vote up 3 votes
/**
 * Creates a new wizard dialog for the given wizard. And as an extra option
 * to standard <strong>WizardDialog</strong> constructor, size of dialog can
 * be given with a <strong>Point</point>.
 * 
 * @param parentShell
 *            - the parent shell
 * @param newWizard
 *            - the wizard this dialog is working on
 * @param size
 *            - size of the dialog (x coordinate : width, y coordinate :
 *            height)
 */
public static WizardDialog createDialog(Shell parentShell, IWizard newWizard, Point size) {
	if (size == null) {
		return new WizardDialog(parentShell, newWizard);
	} else {
		WizardDialog wd = new WizardDialog(parentShell, newWizard);
		// TODO setMinimumPageSize does not work.
		wd.setMinimumPageSize(size);
		wd.setPageSize(size);
		return wd;
	}
}