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

The following examples show how to use org.eclipse.jface.wizard.WizardDialog#setBlockOnOpen() . 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: TestExportCargoProjectWizard.java    From corrosion with Eclipse Public License 2.0 6 votes vote down vote up
private void createWizard(String selectedProjectName) throws IOException, CoreException {
	wizard = new CargoExportWizard();
	if (!selectedProjectName.isEmpty()) {
		IProject project = getProject(selectedProjectName);
		wizard.init(getWorkbench(), new StructuredSelection(project));
	} else {
		wizard.init(getWorkbench(), new StructuredSelection());
	}
	dialog = new WizardDialog(getShell(), wizard);
	dialog.create();
	dialog.setBlockOnOpen(false);
	dialog.open();

	Composite composite = (Composite) wizard.getPages()[0].getControl();
	projectText = (Text) composite.getChildren()[1];
	locationLabel = (Label) composite.getChildren()[4];
}
 
Example 2
Source File: NewLocationAction.java    From RDFS with Apache License 2.0 6 votes vote down vote up
@Override
public void run() {
  WizardDialog dialog = new WizardDialog(null, new Wizard() {
    private HadoopLocationWizard page = new HadoopLocationWizard();

    @Override
    public void addPages() {
      super.addPages();
      setWindowTitle("New Hadoop location...");
      addPage(page);
    }

    @Override
    public boolean performFinish() {
      page.performFinish();
      return true;
    }

  });

  dialog.create();
  dialog.setBlockOnOpen(true);
  dialog.open();

  super.run();
}
 
Example 3
Source File: ChangeColorAction.java    From saros with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void run() {

  ColorChooserWizard wizard = new ColorChooserWizard();

  WizardDialog dialog = new WizardDialog(SWTUtils.getShell(), wizard);
  dialog.setHelpAvailable(false);

  dialog.setBlockOnOpen(true);
  dialog.create();

  if (dialog.open() != Window.OK) return;

  ISarosSession session = sessionManager.getSession();

  if (session == null) return;

  int colorID = wizard.getChosenColor();

  if (!session.getUnavailableColors().contains(colorID)) session.changeColor(colorID);
  else
    MessageDialog.openInformation(
        SWTUtils.getShell(),
        Messages.ChangeColorAction_message_title,
        Messages.ChangeColorAction_message_text);
}
 
Example 4
Source File: NewLocationAction.java    From hadoop-gpu with Apache License 2.0 6 votes vote down vote up
@Override
public void run() {
  WizardDialog dialog = new WizardDialog(null, new Wizard() {
    private HadoopLocationWizard page = new HadoopLocationWizard();

    @Override
    public void addPages() {
      super.addPages();
      setWindowTitle("New Hadoop location...");
      addPage(page);
    }

    @Override
    public boolean performFinish() {
      page.performFinish();
      return true;
    }

  });

  dialog.create();
  dialog.setBlockOnOpen(true);
  dialog.open();

  super.run();
}
 
Example 5
Source File: OpenFileRunnable.java    From ghidra with Apache License 2.0 5 votes vote down vote up
private List<IFile> findMatchingFiles(String path) {
	Collection<IJavaProject> javaProjects = GhidraProjectUtils.getGhidraProjects();
	List<IFile> projectFiles = findMatchingFilesInProjects(path, javaProjects);
	if (projectFiles.isEmpty()) {
		try {
			for (IJavaProject javaProject : javaProjects) {
				javaProject.getProject().refreshLocal(IResource.DEPTH_INFINITE,
					new NullProgressMonitor());
			}
		}
		catch (CoreException e1) {
			EclipseMessageUtils.showErrorDialog("Unable to Open Script",
				"Unexpected Exception refreshing project");
			return new ArrayList<IFile>();
		}
	}

	projectFiles = findMatchingFilesInProjects(path, javaProjects);
	if (projectFiles.isEmpty()) {
		boolean createProject = EclipseMessageUtils.showConfirmDialog("Unable to Open Script",
			"File does not exist in any Eclipse project in your workspace.\n\n" +
				"Would you like to create a new Ghidra Scripting project?");
		if (createProject) {
			INewWizard wizard = new CreateGhidraScriptProjectWizard();
			wizard.init(PlatformUI.getWorkbench(), new StructuredSelection());
			WizardDialog dialog = new WizardDialog(
				PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wizard);
			dialog.setBlockOnOpen(true);
			if (dialog.open() == Window.OK) {
				return findMatchingFilesInProjects(path,
					GhidraProjectUtils.getGhidraProjects());
			}
		}
		return new ArrayList<IFile>();
	}
	return projectFiles;
}
 
Example 6
Source File: DynamicWorkingSetPagePDETest.java    From eclipse-extras with Eclipse Public License 1.0 5 votes vote down vote up
private void openPageInWizardDialog() {
  Wizard wizard = new Wizard() {
    @Override
    public boolean performFinish() {
      return true;
    }
  };
  WizardDialog wizardDialog = new WizardDialog( displayHelper.createShell(), wizard );
  wizard.setContainer( wizardDialog );
  wizard.addPage( page );
  page.setWizard( wizard );
  wizardDialog.setBlockOnOpen( false );
  wizardDialog.open();
  wizardDialog.showPage( page );
}
 
Example 7
Source File: EditLocationAction.java    From RDFS with Apache License 2.0 5 votes vote down vote up
@Override
public void run() {

  final HadoopServer server = serverView.getSelectedServer();
  if (server == null)
    return;

  WizardDialog dialog = new WizardDialog(null, new Wizard() {
    private HadoopLocationWizard page = new HadoopLocationWizard(server);

    @Override
    public void addPages() {
      super.addPages();
      setWindowTitle("Edit Hadoop location...");
      addPage(page);
    }

    @Override
    public boolean performFinish() {
      page.performFinish();
      return true;
    }
  });

  dialog.create();
  dialog.setBlockOnOpen(true);
  dialog.open();

  super.run();
}
 
Example 8
Source File: EditLocationAction.java    From hadoop-gpu with Apache License 2.0 5 votes vote down vote up
@Override
public void run() {

  final HadoopServer server = serverView.getSelectedServer();
  if (server == null)
    return;

  WizardDialog dialog = new WizardDialog(null, new Wizard() {
    private HadoopLocationWizard page = new HadoopLocationWizard(server);

    @Override
    public void addPages() {
      super.addPages();
      setWindowTitle("Edit Hadoop location...");
      addPage(page);
    }

    @Override
    public boolean performFinish() {
      page.performFinish();
      return true;
    }
  });

  dialog.create();
  dialog.setBlockOnOpen(true);
  dialog.open();

  super.run();
}