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

The following examples show how to use org.eclipse.jface.wizard.WizardDialog#setTitle() . 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: OpenExampleIntroAction.java    From statecharts with Eclipse Public License 1.0 6 votes vote down vote up
public void openWizard(String id) {
	IWizardDescriptor descriptor = PlatformUI.getWorkbench()
			.getNewWizardRegistry().findWizard(id);
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getImportWizardRegistry()
				.findWizard(id);
	}
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getExportWizardRegistry()
				.findWizard(id);
	}
	try {
		if (descriptor != null) {
			IWizard wizard = descriptor.createWizard();
			WizardDialog wd = new WizardDialog(Display.getDefault()
					.getActiveShell(), wizard);
			wd.setTitle(wizard.getWindowTitle());
			wd.open();
		}
	} catch (CoreException e) {
		e.printStackTrace();
	}
}
 
Example 2
Source File: GamaNavigatorMenu.java    From gama with GNU General Public License v3.0 6 votes vote down vote up
public static void openWizard(final String id, final IStructuredSelection selection) {
	// First see if this is a "new wizard".
	IWizardDescriptor descriptor = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(id);
	// If not check if it is an "import wizard".
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getImportWizardRegistry().findWizard(id);
	}
	// Or maybe an export wizard
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getExportWizardRegistry().findWizard(id);
	}
	try {
		// Then if we have a wizard, open it.
		if (descriptor != null) {
			final IWorkbenchWizard wizard = descriptor.createWizard();
			wizard.init(PlatformUI.getWorkbench(), selection);
			final WizardDialog wd = new WizardDialog(WorkbenchHelper.getDisplay().getActiveShell(), wizard);
			wd.setTitle(wizard.getWindowTitle());
			wd.open();
		}
	} catch (final CoreException e) {
		e.printStackTrace();
	}
}
 
Example 3
Source File: ExportArtifactsToZip.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    IRepository currentRepository = RepositoryManager.getInstance().getCurrentRepository();
    String defaultName = currentRepository.getName() + "_" + new SimpleDateFormat("ddMMyy_HHmm").format(new Date()) + ".bos";
    Set<Object> selectedFiles = new HashSet<Object>() ;
    for(IRepositoryStore store : currentRepository.getAllExportableStores()){
        List<IRepositoryFileStore> files = store.getChildren() ;
        if( files != null){
            files.remove(null) ;
            selectedFiles.addAll(files) ;
        }
    }

    ExportRepositoryWizard wizard = new ExportRepositoryWizard(currentRepository.getAllExportableStores(),true,selectedFiles,defaultName,Messages.exportRepositoryTitle) ;
    WizardDialog dialog = new WizardDialog(
            PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
            wizard ){
    	protected void initializeBounds() {
    		super.initializeBounds();
    		getShell().setSize(500, 500); 
    	}
    };
    dialog.setTitle(Messages.exportArtifactsWizard_title);
    dialog.open() ;
    return null;
}
 
Example 4
Source File: WizardUtils.java    From xds-ide with Eclipse Public License 1.0 5 votes vote down vote up
public static void openWizard(String wizardId, Shell parentShell, ISelection selection) {
    // First see if this is a "new wizard".
    IWizardDescriptor descriptor = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(wizardId);
    // If not check if it is an "import wizard".
    if  (descriptor == null) {
      descriptor = PlatformUI.getWorkbench().getImportWizardRegistry().findWizard(wizardId);
    }
    // Or maybe an export wizard
    if  (descriptor == null) {
      descriptor = PlatformUI.getWorkbench().getExportWizardRegistry().findWizard(wizardId);
    }
    try  {
      // Then if we have a wizard, open it.
      if  (descriptor != null) {
        IWizard wizard = descriptor.createWizard();
        if (wizard instanceof IWorkbenchWizard) {
            IStructuredSelection structuredSelection = selection instanceof IStructuredSelection?  (IStructuredSelection)selection : new StructuredSelection();
            ((IWorkbenchWizard)wizard).init(PlatformUI.getWorkbench(), structuredSelection);
            WizardDialog wd = new WizardDialog(parentShell, wizard);
            wd.setTitle(wizard.getWindowTitle());
            wd.open();
        }
        else {
            Assert.isTrue(false, "Attempt to call not IWorkbenchWizard"); //$NON-NLS-1$
        }
      }
    } catch  (CoreException e) {
      e.printStackTrace();
    }
}
 
Example 5
Source File: OpenCamelExistVersionProcessAction.java    From tesb-studio-se with Apache License 2.0 5 votes vote down vote up
@Override
protected void doRun() {
    ISelection selection = getSelection();
    Object obj = ((IStructuredSelection) selection).getFirstElement();
    IRepositoryNode node = (IRepositoryNode) obj;

    IPath path = RepositoryNodeUtilities.getPath(node);
    String originalName = node.getObject().getLabel();

    RepositoryObject repositoryObj = new RepositoryObject(node.getObject().getProperty());
    repositoryObj.setRepositoryNode(node.getObject().getRepositoryNode());
    OpenCamelExistVersionProcessWizard wizard = new OpenCamelExistVersionProcessWizard(repositoryObj);
    WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
    dialog.setHelpAvailable(false);
    dialog.setPageSize(300, 250);
    dialog.setTitle(Messages.getString("OpenExistVersionProcess.open.dialog")); //$NON-NLS-1$
    if (dialog.open() == Dialog.OK) {
        refresh(node);
        // refresh the corresponding editor's name
        IEditorPart part = getCorrespondingEditor(node);
        if (part != null && part instanceof IUIRefresher) {
            ((IUIRefresher) part).refreshName();
        } else {
            processRoutineRenameOperation(originalName, node, path);
        }
    }
}
 
Example 6
Source File: CommonRepositoryPlugin.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * open a wizard in which you can select a destination + which artifact you want to export
 * 
 * @param stores
 *   repositories or artifacts you want to put in the tree
 * @param showImages
 * 	Whether to show icons on repositories/artifacts or not
 * @param selectAllByDefault
 */
public static void exportArtifactsToFile(List<IRepositoryStore<? extends IRepositoryFileStore>> stores, Set<Object> selectFilesByDefault, String dialogTitle) {
    if(dialogTitle == null || dialogTitle.isEmpty()){
        dialogTitle = Messages.exportRepositoryFileTitle ;
    }
    ExportRepositoryWizard wizard = new ExportRepositoryWizard(stores,false,selectFilesByDefault,null,dialogTitle);
    WizardDialog dialog = new CustomWizardDialog(Display.getCurrent().getActiveShell(), wizard){
    	protected void initializeBounds() {
    		super.initializeBounds();
    		getShell().setSize(600, 500); 
    	}
    };
    dialog.setTitle(dialogTitle);
    dialog.open() ;
}
 
Example 7
Source File: ExportBosArchiveHandler.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
@Execute
public void execute(RepositoryAccessor repositoryAccessor,
        @org.eclipse.e4.core.di.annotations.Optional @Named("diagram") String diagramToExport) {
    if (PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().saveAllEditors(true)) {
        Set<Object> selectedFiles = new HashSet<>();
      
        try {
            PlatformUI.getWorkbench().getProgressService().run(true, false, monitor -> {
                final MainProcess diagram = diagramToExport != null
                        ? getDiagram(repositoryAccessor, diagramToExport)
                        : getDiagramInEditor();
                final List<IRepositoryStore<? extends IRepositoryFileStore>> exportableStores = RepositoryManager
                        .getInstance()
                        .getCurrentRepository()
                        .getAllExportableStores();
                if (diagram != null) {
                    //Use a progress monitor as it can takes a few seconds for big diagrams
                    monitor.beginTask(String.format(Messages.resolvingDiagramDependencies, 
                            diagram.getName(),
                            diagram.getVersion()), 
                            IProgressMonitor.UNKNOWN);
                    selectedFiles.addAll(getAllDiagramRelatedFiles(diagram));
                } else {
                    for (final IRepositoryStore<? extends IRepositoryFileStore> store : exportableStores) {
                        final List<? extends IRepositoryFileStore> files = store.getChildren();
                        if (files != null) {
                            for (final IRepositoryFileStore fStore : files) {
                                if (fStore != null && fStore.canBeExported()) {
                                    selectedFiles.add(fStore);
                                }
                            }
                        }
                    }
                }
            });
        } catch (InvocationTargetException | InterruptedException e) {
            BonitaStudioLog.error(e);
        }
        
        
        if (selectedFiles != null) {
            final ExportRepositoryWizard wizard = new ExportRepositoryWizard(
                    RepositoryManager.getInstance().getCurrentRepository()
                            .getAllExportableStores(),
                    true, selectedFiles, getDefaultName(), Messages.ExportButtonLabel);
            final WizardDialog dialog = new WizardDialog(
                    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
                    wizard) {

                @Override
                protected void initializeBounds() {
                    super.initializeBounds();
                    getShell().setSize(600, 600);
                }
            };
            dialog.setTitle(Messages.ExportButtonLabel);
            dialog.open();
        }
    }
}