@Override public void createInitialLayout(IPageLayout layout) { String editorArea = layout.getEditorArea(); IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT, (float) 0.25, editorArea); //$NON-NLS-1$ left.addView(IPageLayout.ID_PROJECT_EXPLORER); left.addPlaceholder(IPageLayout.ID_RES_NAV); IFolderLayout bottom = layout.createFolder("bottom", IPageLayout.BOTTOM, (float) 0.75, editorArea); //$NON-NLS-1$ bottom.addView("org.eclipse.tm.terminal.view.ui.TerminalsView"); bottom.addView(IPageLayout.ID_PROBLEM_VIEW); bottom.addPlaceholder(TemplatesView.ID); bottom.addPlaceholder(NewSearchUI.SEARCH_VIEW_ID); bottom.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW); bottom.addPlaceholder(IPageLayout.ID_BOOKMARKS); bottom.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID); bottom.addPlaceholder(IPageLayout.ID_TASK_LIST); bottom.addPlaceholder(IPageLayout.ID_PROP_SHEET); layout.addView(IPageLayout.ID_OUTLINE, IPageLayout.RIGHT, (float) 0.75, editorArea); }
/** * Called when the job is finished. */ protected void doFinish() { // setProperty(IProgressConstants.ICON_PROPERTY, image); if (AbstractJob.isModal(this)) { Display.getDefault().asyncExec(new Runnable() { public void run() { getJobCompletedAction().run(); } }); } else { setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.TRUE); setProperty(IProgressConstants.ACTION_PROPERTY, getJobCompletedAction()); } }
protected void addFolders(IPageLayout layout) { IFolderLayout leftFolder = layout.createFolder("left", IPageLayout.LEFT, (float) 0.2, //$NON-NLS-1$ layout.getEditorArea()); leftFolder.addView(DLTKUIPlugin.ID_SCRIPT_EXPLORER); leftFolder.addView("org.eclipse.dltk.testing.ResultView"); //$NON-NLS-1$ leftFolder.addPlaceholder("org.eclipse.dltk.ui.TypeHierarchy"); //$NON-NLS-1$ leftFolder.addPlaceholder(IPageLayout.ID_BOOKMARKS); IFolderLayout bottomFolder = layout.createFolder("bottom", IPageLayout.BOTTOM, (float) 0.75, //$NON-NLS-1$ layout.getEditorArea()); bottomFolder.addView(IPageLayout.ID_PROBLEM_VIEW); bottomFolder.addView(IPageLayout.ID_TASK_LIST); bottomFolder.addView(IConsoleConstants.ID_CONSOLE_VIEW); bottomFolder.addPlaceholder("org.eclipse.dltk.callhierarchy.view"); //$NON-NLS-1$ bottomFolder.addPlaceholder(NewSearchUI.SEARCH_VIEW_ID); bottomFolder.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID); }
protected void addDownloadJob(DownloadJob downloadJob) { if (downloadJob != null) { // This is a non-user job, so make sure that it has no presence in the // Progress View downloadJob.setSystem(true); downloadJob.addJobChangeListener(removeJobOnCompleteListener); // If the job returns an ERROR status, make sure that it does not show // a modal dialog with the ERROR information; we want a silent failure downloadJob.setProperty( IProgressConstants.NO_IMMEDIATE_ERROR_PROMPT_PROPERTY, true); synchronized (downloadJobs) { downloadJob.schedule(); downloadJobs.add(downloadJob); } } }
@Override protected IStatus run(IProgressMonitor monitor) { IStatus jobStatus = Status.OK_STATUS; try { jobStatus = untar.run(monitor); } catch (InvocationTargetException e) { jobStatus = new Status(Status.ERROR, CorePlugin.PLUGIN_ID, "Invocation Target Exception", e); } setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.TRUE); setProperty(IProgressConstants.ACTION_PROPERTY, getViewStatusAction(jobStatus)); maybeFireCompletedAction(jobStatus); monitor.done(); return jobStatus; }
/** * Run the unzip job using the provided monitor. */ @Override protected IStatus run(IProgressMonitor monitor) { IStatus jobStatus = Status.OK_STATUS; try { jobStatus = unzip.run(monitor); } catch (InvocationTargetException e) { jobStatus = new Status(Status.ERROR, CorePlugin.PLUGIN_ID, "Invocation Target Exception", e); } setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.TRUE); setProperty(IProgressConstants.ACTION_PROPERTY, getViewStatusAction(jobStatus)); maybeFireCompletedAction(jobStatus); monitor.done(); return jobStatus; }
/** * Create a new job for the given project and job id. * * @param project * The project the job is for * @param jobId * The job id of the new job * @param timestamp * The timestamp when the job was initiated */ public CustomDynamicSpotterRunJob(ConfigAlternative alternative, long jobId) { super("DynamicSpotter Diagnosis '" + alternative.getName() + "'"); this.project = alternative.getProject(); this.alternative = alternative; this.jobId = jobId; this.silentCancel = false; this.timestamp = System.currentTimeMillis(); ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, ICON_PATH); setProperty(IProgressConstants.ICON_PROPERTY, imageDescriptor); setProperty(JOB_ID_KEY, String.valueOf(jobId)); setPriority(LONG); setUser(true); if (!JobsContainer.registerJobId(project, jobId, timestamp)) { DialogUtils.openError(RunHandler.DIALOG_TITLE, "There was an error when saving the job id. You may not access the results of the diagnosis run."); } }
/** * @param layout * @param editorArea */ public void defineLayout(IPageLayout layout) { String editorArea = layout.getEditorArea(); IFolderLayout topLeft = layout.createFolder("topLeft", IPageLayout.LEFT, (float) 0.26, editorArea); //$NON-NLS-1$ topLeft.addView("org.python.pydev.navigator.view"); IFolderLayout outputfolder = layout.createFolder("bottom", IPageLayout.BOTTOM, (float) 0.75, editorArea); //$NON-NLS-1$ //outputfolder.addView(IPageLayout.ID_PROBLEM_VIEW); outputfolder.addPlaceholder(NewSearchUI.SEARCH_VIEW_ID); outputfolder.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW); outputfolder.addPlaceholder(IPageLayout.ID_BOOKMARKS); outputfolder.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID); //Add the outline only if we're not using the minimap. if (!MinimapOverviewRulerPreferencesPage.getShowMinimapContents()) { layout.addView(IPageLayout.ID_OUTLINE, IPageLayout.RIGHT, (float) 0.75, editorArea); } }
/** * Creates the initial perspective layout. * * @param layout */ public void createInitialLayout(IPageLayout layout) { String editorArea = layout.getEditorArea(); layout.setEditorAreaVisible(false); layout.setFixed(false); IFolderLayout main = layout.createFolder("main", IPageLayout.LEFT, 1.0f, editorArea); IFolderLayout sidebar = layout.createFolder("right", IPageLayout.RIGHT, 0.6f, "main"); // Main area main.addView(Dashboard.ID); main.addView(StatisticsView.ID); main.addPlaceholder(ChartView.ID); main.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID); // Sidebar sidebar.addView(SidebarView.ID); layout.getViewLayout(StatisticsView.ID).setCloseable(false); layout.getViewLayout(SidebarView.ID).setCloseable(false); }
private void addViews() { IFolderLayout bottom = factory.createFolder( "bottomRight", //NON-NLS-1 IPageLayout.BOTTOM, 0.75f, factory.getEditorArea()); bottom.addView(IPageLayout.ID_PROP_SHEET); bottom.addView("org.gw4e.eclipse.views.PerformanceView"); bottom.addView(IPageLayout.ID_PROBLEM_VIEW); bottom.addView(JavaUI.ID_JAVADOC_VIEW); bottom.addView(JavaUI.ID_SOURCE_VIEW); bottom.addPlaceholder(NewSearchUI.SEARCH_VIEW_ID); bottom.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW); bottom.addPlaceholder(IPageLayout.ID_BOOKMARKS); bottom.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID); IFolderLayout topLeft = factory.createFolder( "topLeft", //NON-NLS-1 IPageLayout.LEFT, 0.15f, factory.getEditorArea()); topLeft.addView(JavaUI.ID_PACKAGES); topLeft.addPlaceholder(JavaUI.ID_TYPE_HIERARCHY); topLeft.addPlaceholder(JavaPlugin.ID_RES_NAV); topLeft.addPlaceholder(IPageLayout.ID_PROJECT_EXPLORER); IFolderLayout outlineFolder = factory.createFolder("right", IPageLayout.RIGHT, (float) 0.85, factory.getEditorArea()); //$NON-NLS-1$ outlineFolder.addView(IPageLayout.ID_OUTLINE); }
public EclipseHttpJob( long duration, boolean lock, /*boolean failure,*/ boolean indeterminate/*, boolean reschedule, long rescheduleWait*/) { super("http4e loading.."); this.duration = duration; // this.failure = failure; this.unknown = indeterminate; // this.reschedule = reschedule; // this.rescheduleWait = rescheduleWait; if (lock) setRule(ResourcesPlugin.getWorkspace().getRoot()); setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.valueOf("true")); setProperty(IProgressConstants.KEEPONE_PROPERTY, Boolean.valueOf("true")); schedule(10); }
private void addViews() { IFolderLayout bottom = layoutFactory.createFolder("bottomRight", // NON-NLS-1 IPageLayout.BOTTOM, 0.75f, layoutFactory.getEditorArea()); bottom.addView(PluginConst.RESULT_VIEW_ID); bottom.addView(IPageLayout.ID_PROBLEM_VIEW); bottom.addView(IProgressConstants.PROGRESS_VIEW_ID); IFolderLayout topLeft = layoutFactory.createFolder("topLeft", // NON-NLS-1 IPageLayout.LEFT, 0.25f, layoutFactory.getEditorArea()); topLeft.addView(IConsoleConstants.ID_CONSOLE_VIEW); topLeft.addView(IPageLayout.ID_PROJECT_EXPLORER);//ID_RES_NAV); }
protected void addShowViewShortcuts(IPageLayout layout) { layout.addShowViewShortcut(IPageLayout.ID_OUTLINE); layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW); layout.addShowViewShortcut(DLTKUIPlugin.ID_SCRIPT_EXPLORER); layout.addShowViewShortcut("org.eclipse.dltk.testing.ResultView"); //$NON-NLS-1$ layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST); layout.addShowViewShortcut(IProgressConstants.PROGRESS_VIEW_ID); layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW); layout.addShowViewShortcut("org.eclipse.dltk.ui.TypeHierarchy"); //$NON-NLS-1$ layout.addShowViewShortcut("org.eclipse.dltk.callhierarchy.view"); //$NON-NLS-1$ }
private void createVerticalLayout(IPageLayout layout) { String relativePartId= IPageLayout.ID_EDITOR_AREA; int relativePos= IPageLayout.LEFT; IPlaceholderFolderLayout placeHolderLeft= layout.createPlaceholderFolder("left", IPageLayout.LEFT, (float)0.25, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ placeHolderLeft.addPlaceholder(JavaUI.ID_TYPE_HIERARCHY); placeHolderLeft.addPlaceholder(IPageLayout.ID_OUTLINE); placeHolderLeft.addPlaceholder(JavaUI.ID_PACKAGES); placeHolderLeft.addPlaceholder(JavaPlugin.ID_RES_NAV); placeHolderLeft.addPlaceholder(IPageLayout.ID_PROJECT_EXPLORER); if (shouldShowProjectsView()) { layout.addView(JavaUI.ID_PROJECTS_VIEW, IPageLayout.LEFT, (float)0.25, IPageLayout.ID_EDITOR_AREA); relativePartId= JavaUI.ID_PROJECTS_VIEW; relativePos= IPageLayout.BOTTOM; } if (shouldShowPackagesView()) { layout.addView(JavaUI.ID_PACKAGES_VIEW, relativePos, (float)0.25, relativePartId); relativePartId= JavaUI.ID_PACKAGES_VIEW; relativePos= IPageLayout.BOTTOM; } layout.addView(JavaUI.ID_TYPES_VIEW, relativePos, (float)0.33, relativePartId); layout.addView(JavaUI.ID_MEMBERS_VIEW, IPageLayout.BOTTOM, (float)0.50, JavaUI.ID_TYPES_VIEW); IPlaceholderFolderLayout placeHolderBottom= layout.createPlaceholderFolder("bottom", IPageLayout.BOTTOM, (float)0.75, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ placeHolderBottom.addPlaceholder(IPageLayout.ID_PROBLEM_VIEW); placeHolderBottom.addPlaceholder(NewSearchUI.SEARCH_VIEW_ID); placeHolderBottom.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW); placeHolderBottom.addPlaceholder(IPageLayout.ID_BOOKMARKS); placeHolderBottom.addPlaceholder(JavaUI.ID_SOURCE_VIEW); placeHolderBottom.addPlaceholder(JavaUI.ID_JAVADOC_VIEW); placeHolderBottom.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID); }
private void createHorizontalLayout(IPageLayout layout) { String relativePartId= IPageLayout.ID_EDITOR_AREA; int relativePos= IPageLayout.TOP; if (shouldShowProjectsView()) { layout.addView(JavaUI.ID_PROJECTS_VIEW, IPageLayout.TOP, (float)0.25, IPageLayout.ID_EDITOR_AREA); relativePartId= JavaUI.ID_PROJECTS_VIEW; relativePos= IPageLayout.RIGHT; } if (shouldShowPackagesView()) { layout.addView(JavaUI.ID_PACKAGES_VIEW, relativePos, (float)0.25, relativePartId); relativePartId= JavaUI.ID_PACKAGES_VIEW; relativePos= IPageLayout.RIGHT; } layout.addView(JavaUI.ID_TYPES_VIEW, relativePos, (float)0.33, relativePartId); layout.addView(JavaUI.ID_MEMBERS_VIEW, IPageLayout.RIGHT, (float)0.50, JavaUI.ID_TYPES_VIEW); IPlaceholderFolderLayout placeHolderLeft= layout.createPlaceholderFolder("left", IPageLayout.LEFT, (float)0.25, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ placeHolderLeft.addPlaceholder(JavaUI.ID_TYPE_HIERARCHY); placeHolderLeft.addPlaceholder(IPageLayout.ID_OUTLINE); placeHolderLeft.addPlaceholder(JavaUI.ID_PACKAGES); placeHolderLeft.addPlaceholder(JavaPlugin.ID_RES_NAV); placeHolderLeft.addPlaceholder(IPageLayout.ID_PROJECT_EXPLORER); IPlaceholderFolderLayout placeHolderBottom= layout.createPlaceholderFolder("bottom", IPageLayout.BOTTOM, (float)0.75, IPageLayout.ID_EDITOR_AREA); //$NON-NLS-1$ placeHolderBottom.addPlaceholder(IPageLayout.ID_PROBLEM_VIEW); placeHolderBottom.addPlaceholder(NewSearchUI.SEARCH_VIEW_ID); placeHolderBottom.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW); placeHolderBottom.addPlaceholder(IPageLayout.ID_BOOKMARKS); placeHolderBottom.addPlaceholder(JavaUI.ID_SOURCE_VIEW); placeHolderBottom.addPlaceholder(JavaUI.ID_JAVADOC_VIEW); placeHolderBottom.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID); }
@Override public Object execute(ExecutionEvent arg0) throws ExecutionException { Job updateJob = new UpdateCheckerJob(updateManager); updateJob.schedule(); updateJob.addJobChangeListener(new UpdateCheckerJobListener( updateManager, ActiveTab.UPDATE_FEATURES, false)); try { PlatformUI.getWorkbench().getActiveWorkbenchWindow() .getActivePage().showView(IProgressConstants.PROGRESS_VIEW_ID); } catch (PartInitException e) { log.error(e); } return null; }
@Override public Object execute(ExecutionEvent arg0) throws ExecutionException { Job updateJob = new UpdateCheckerJob(updateManager); updateJob.schedule(); updateJob.addJobChangeListener(new UpdateCheckerJobListener( updateManager, ActiveTab.ALL_FEATURES, false)); try { PlatformUI.getWorkbench().getActiveWorkbenchWindow() .getActivePage().showView(IProgressConstants.PROGRESS_VIEW_ID); } catch (PartInitException e) { log.error(e); } return null; }
/** * Create a new job for the given project and job id. * * @param project * The project the job is for * @param jobId * The job id of the new job * @param timestamp * The timestamp when the job was initiated */ public DynamicSpotterRunJob(final IProject project, final long jobId, long timestamp) { super("DynamicSpotter Diagnosis '" + project.getName() + "'"); this.project = project; this.jobId = jobId; this.silentCancel = false; ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, ICON_PATH); setProperty(IProgressConstants.ICON_PROPERTY, imageDescriptor); IAction gotoAction = new Action("Results") { public void run() { revealResults(); } }; setProperty(IProgressConstants.ACTION_PROPERTY, gotoAction); setProperty(JOB_ID_KEY, String.valueOf(jobId)); setPriority(LONG); setUser(true); if (!JobsContainer.registerJobId(project, jobId, timestamp)) { DialogUtils.openError(RunHandler.DIALOG_TITLE, "There was an error when saving the job id. You may not access the results of the diagnosis run."); } }
protected void scheduleExportJob() throws IOException { Path folder = Files.createTempDirectory("eclipse-export", new FileAttribute<?>[0]); final FeatureExportInfo info = new FeatureExportInfo(); info.toDirectory = false; // in order to install from the repository info.useJarFormat = true; info.exportSource = false; info.exportSourceBundle = false; info.allowBinaryCycles = true; info.useWorkspaceCompiledClasses = false; info.destinationDirectory = folder.toString(); info.zipFileName = "p2-repo.zip"; info.items = getFeatures(); info.signingInfo = null; // info.exportMetadata = true; info.qualifier = QualifierReplacer.getDateQualifier(); final FeatureExportOperation job = new FeatureExportOperation(info, PDEUIMessages.FeatureExportJob_name); job.setUser(true); job.setRule(ResourcesPlugin.getWorkspace().getRoot()); job.setProperty(IProgressConstants.ICON_PROPERTY, PDEPluginImages.DESC_PLUGIN_OBJ); // listen to job changes, we'll upload stuff when the building has been done job.addJobChangeListener(new JobChangeAdapter() { public void done(IJobChangeEvent event) { if (job.hasAntErrors()) { // if there were errors when running the ant scripts, inform // the user where the logs can be found. final File logLocation = new File(info.destinationDirectory, "logs.zip"); //$NON-NLS-1$ if (logLocation.exists()) { PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() { public void run() { AntErrorDialog dialog = new AntErrorDialog(logLocation); dialog.open(); } }); } } else if (event.getResult().isOK()) { // can publish try (CloseableHttpClient client = HttpClientBuilder.create().build()) { // sign in and upload items if (signIn(client)) { uploadForm(client); // upload the images if (solution.getScreenshot() != null) { uploadFile(client, Paths.get(solution.getScreenshot()), "upload-screenshot"); } if (solution.getImage() != null) { uploadFile(client, Paths.get(solution.getImage()), "upload-image"); } // upload the repository uploadFile(client, folder.resolve("p2-repo.zip"),"upload-p2repo"); } } catch (Exception e) { e.printStackTrace(); addMessage(IMessage.ERROR, e.getMessage()); } } } }); job.schedule(); }
@Override public void createInitialLayout(IPageLayout layout) { String editorArea = layout.getEditorArea(); IFolderLayout folder= layout.createFolder("left", IPageLayout.LEFT, (float)0.2, editorArea); folder.addView("jasonide.navigatorView"); folder.addPlaceholder(JavaUI.ID_TYPE_HIERARCHY); folder.addPlaceholder(IPageLayout.ID_RES_NAV); folder.addPlaceholder("org.eclipse.ui.navigator.ProjectExplorer"); IFolderLayout outputfolder= layout.createFolder("bottom", IPageLayout.BOTTOM, (float)0.75, editorArea); outputfolder.addView(IPageLayout.ID_TASK_LIST); outputfolder.addView(IPageLayout.ID_PROBLEM_VIEW); outputfolder.addView(JavaUI.ID_SOURCE_VIEW); outputfolder.addView(JavaUI.ID_JAVADOC_VIEW); outputfolder.addView(IConsoleConstants.ID_CONSOLE_VIEW); outputfolder.addPlaceholder(NewSearchUI.SEARCH_VIEW_ID); outputfolder.addPlaceholder(IPageLayout.ID_BOOKMARKS); outputfolder.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID); IFolderLayout outlineFolder = layout.createFolder("right", IPageLayout.RIGHT, (float)0.75, editorArea); outlineFolder.addView(IPageLayout.ID_OUTLINE); outlineFolder.addPlaceholder(TemplatesView.ID); layout.addShowViewShortcut("jasonide.navigatorView"); layout.addShowViewShortcut(JavaUI.ID_SOURCE_VIEW); layout.addShowViewShortcut(JavaUI.ID_JAVADOC_VIEW); layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW); layout.addShowViewShortcut(IPageLayout.ID_OUTLINE); layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW); layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST); layout.addNewWizardShortcut("jasonide.newJasonProjectWizard"); layout.addNewWizardShortcut("jasonide.newAgentWizard"); layout.addNewWizardShortcut("jasonide.newArtifactWizard"); layout.addNewWizardShortcut("jasonide.newInternalActionWizard"); layout.addNewWizardShortcut("jasonide.newAslFileWizard"); layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewPackageCreationWizard"); layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewClassCreationWizard"); layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard"); layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewEnumCreationWizard"); layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewAnnotationCreationWizard"); layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard"); layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSnippetFileCreationWizard"); layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewJavaWorkingSetWizard"); layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder"); layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file"); layout.addNewWizardShortcut("org.eclipse.ui.editors.wizards.UntitledTextFileWizard"); }
public ConnectToBookmarksStoreJob(IRemoteBookmarksStoreDescriptor storeDescriptor) { super("Connecting to " + storeDescriptor.getLabel()); this.storeDescriptor = storeDescriptor; setProperty(IProgressConstants.ICON_PROPERTY, storeDescriptor.getImageDescriptor()); }
public void createInitialLayout(IPageLayout layout) { String editorArea = layout.getEditorArea(); IFolderLayout folder= layout.createFolder("left", IPageLayout.LEFT, (float)0.25, editorArea); //$NON-NLS-1$ folder.addView(JavaUI.ID_PACKAGES); folder.addPlaceholder(JavaUI.ID_TYPE_HIERARCHY); folder.addPlaceholder(JavaPlugin.ID_RES_NAV); folder.addPlaceholder(IPageLayout.ID_PROJECT_EXPLORER); IFolderLayout outputfolder= layout.createFolder("bottom", IPageLayout.BOTTOM, (float)0.75, editorArea); //$NON-NLS-1$ outputfolder.addView(IPageLayout.ID_PROBLEM_VIEW); outputfolder.addView(JavaUI.ID_JAVADOC_VIEW); outputfolder.addView(JavaUI.ID_SOURCE_VIEW); outputfolder.addPlaceholder(NewSearchUI.SEARCH_VIEW_ID); outputfolder.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW); outputfolder.addPlaceholder(IPageLayout.ID_BOOKMARKS); outputfolder.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID); IFolderLayout outlineFolder = layout.createFolder("right", IPageLayout.RIGHT, (float)0.75, editorArea); //$NON-NLS-1$ outlineFolder.addView(IPageLayout.ID_OUTLINE); outlineFolder.addPlaceholder(TemplatesView.ID); layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET); layout.addActionSet(JavaUI.ID_ACTION_SET); layout.addActionSet(JavaUI.ID_ELEMENT_CREATION_ACTION_SET); layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET); // views - java layout.addShowViewShortcut(JavaUI.ID_PACKAGES); layout.addShowViewShortcut(JavaUI.ID_TYPE_HIERARCHY); layout.addShowViewShortcut(JavaUI.ID_SOURCE_VIEW); layout.addShowViewShortcut(JavaUI.ID_JAVADOC_VIEW); // views - search layout.addShowViewShortcut(NewSearchUI.SEARCH_VIEW_ID); // views - debugging layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW); // views - standard workbench layout.addShowViewShortcut(IPageLayout.ID_OUTLINE); layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW); layout.addShowViewShortcut(JavaPlugin.ID_RES_NAV); layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST); layout.addShowViewShortcut(IProgressConstants.PROGRESS_VIEW_ID); layout.addShowViewShortcut(IPageLayout.ID_PROJECT_EXPLORER); layout.addShowViewShortcut(TemplatesView.ID); layout.addShowViewShortcut("org.eclipse.pde.runtime.LogView"); //$NON-NLS-1$ // new actions - Java project creation wizard layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.JavaProjectWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewPackageCreationWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewClassCreationWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewEnumCreationWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewAnnotationCreationWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSnippetFileCreationWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewJavaWorkingSetWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.ui.editors.wizards.UntitledTextFileWizard");//$NON-NLS-1$ // 'Window' > 'Open Perspective' contributions layout.addPerspectiveShortcut(JavaUI.ID_BROWSING_PERSPECTIVE); layout.addPerspectiveShortcut(IDebugUIConstants.ID_DEBUG_PERSPECTIVE); }
public void createInitialLayout(IPageLayout layout) { if (stackBrowsingViewsVertically()) createVerticalLayout(layout); else createHorizontalLayout(layout); // action sets layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET); layout.addActionSet(JavaUI.ID_ACTION_SET); layout.addActionSet(JavaUI.ID_ELEMENT_CREATION_ACTION_SET); layout.addActionSet(IPageLayout.ID_NAVIGATE_ACTION_SET); // views - java layout.addShowViewShortcut(JavaUI.ID_TYPE_HIERARCHY); layout.addShowViewShortcut(JavaUI.ID_PACKAGES); layout.addShowViewShortcut(JavaUI.ID_PROJECTS_VIEW); layout.addShowViewShortcut(JavaUI.ID_PACKAGES_VIEW); layout.addShowViewShortcut(JavaUI.ID_TYPES_VIEW); layout.addShowViewShortcut(JavaUI.ID_MEMBERS_VIEW); layout.addShowViewShortcut(JavaUI.ID_SOURCE_VIEW); layout.addShowViewShortcut(JavaUI.ID_JAVADOC_VIEW); layout.addShowViewShortcut(TemplatesView.ID); // views - search layout.addShowViewShortcut(NewSearchUI.SEARCH_VIEW_ID); // views - debugging layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW); // views - standard workbench layout.addShowViewShortcut(IPageLayout.ID_OUTLINE); layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW); layout.addShowViewShortcut(JavaPlugin.ID_RES_NAV); layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST); layout.addShowViewShortcut(IProgressConstants.PROGRESS_VIEW_ID); layout.addShowViewShortcut(IPageLayout.ID_PROJECT_EXPLORER); layout.addShowViewShortcut("org.eclipse.pde.runtime.LogView"); //$NON-NLS-1$ // new actions - Java project creation wizard layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.JavaProjectWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewPackageCreationWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewClassCreationWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewEnumCreationWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewAnnotationCreationWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSnippetFileCreationWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewJavaWorkingSetWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.ui.editors.wizards.UntitledTextFileWizard");//$NON-NLS-1$ // 'Window' > 'Open Perspective' contributions layout.addPerspectiveShortcut(JavaUI.ID_PERSPECTIVE); layout.addPerspectiveShortcut(IDebugUIConstants.ID_DEBUG_PERSPECTIVE); }
public void createInitialLayout(IPageLayout layout) { String editorArea = layout.getEditorArea(); IFolderLayout folder= layout.createFolder("left", IPageLayout.LEFT, (float)0.25, editorArea); //$NON-NLS-1$ folder.addView(JavaUI.ID_TYPE_HIERARCHY); folder.addPlaceholder(IPageLayout.ID_OUTLINE); folder.addPlaceholder(JavaUI.ID_PACKAGES); folder.addPlaceholder(JavaPlugin.ID_RES_NAV); folder.addPlaceholder(IPageLayout.ID_PROJECT_EXPLORER); IPlaceholderFolderLayout outputfolder= layout.createPlaceholderFolder("bottom", IPageLayout.BOTTOM, (float)0.75, editorArea); //$NON-NLS-1$ outputfolder.addPlaceholder(IPageLayout.ID_PROBLEM_VIEW); outputfolder.addPlaceholder(NewSearchUI.SEARCH_VIEW_ID); outputfolder.addPlaceholder(IConsoleConstants.ID_CONSOLE_VIEW); outputfolder.addPlaceholder(IPageLayout.ID_BOOKMARKS); outputfolder.addPlaceholder(JavaUI.ID_SOURCE_VIEW); outputfolder.addPlaceholder(JavaUI.ID_JAVADOC_VIEW); outputfolder.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID); layout.addActionSet(IDebugUIConstants.LAUNCH_ACTION_SET); layout.addActionSet(JavaUI.ID_ACTION_SET); layout.addActionSet(JavaUI.ID_ELEMENT_CREATION_ACTION_SET); // views - java layout.addShowViewShortcut(JavaUI.ID_PACKAGES); layout.addShowViewShortcut(JavaUI.ID_TYPE_HIERARCHY); layout.addShowViewShortcut(NewSearchUI.SEARCH_VIEW_ID); // views - debugging layout.addShowViewShortcut(IConsoleConstants.ID_CONSOLE_VIEW); // views - standard workbench layout.addShowViewShortcut(IPageLayout.ID_OUTLINE); layout.addShowViewShortcut(IPageLayout.ID_PROBLEM_VIEW); layout.addShowViewShortcut(JavaPlugin.ID_RES_NAV); layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST); layout.addShowViewShortcut(IProgressConstants.PROGRESS_VIEW_ID); layout.addShowViewShortcut(IPageLayout.ID_PROJECT_EXPLORER); layout.addShowViewShortcut(TemplatesView.ID); layout.addShowViewShortcut("org.eclipse.pde.runtime.LogView"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.JavaProjectWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewPackageCreationWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewClassCreationWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewEnumCreationWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewAnnotationCreationWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewSnippetFileCreationWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.jdt.ui.wizards.NewJavaWorkingSetWizard"); //$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");//$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");//$NON-NLS-1$ layout.addNewWizardShortcut("org.eclipse.ui.editors.wizards.UntitledTextFileWizard");//$NON-NLS-1$ // 'Window' > 'Open Perspective' contributions layout.addPerspectiveShortcut(JavaUI.ID_PERSPECTIVE); layout.addPerspectiveShortcut(JavaUI.ID_BROWSING_PERSPECTIVE); layout.addPerspectiveShortcut(IDebugUIConstants.ID_DEBUG_PERSPECTIVE); }
/** * Install selected updates in to developer studio. Note: call * {@link #setSelectedUpdates(List) setSelectedUpdates} first. * * @param monitor */ public void installSelectedUpdates(IProgressMonitor monitor) { SubMonitor progress = SubMonitor.convert(monitor, Messages.UpdateManager_26, 2); URI[] repos = new URI[] { getDevStudioUpdateSite() }; session = new ProvisioningSession(p2Agent); updateOperation = new UpdateOperation(session); updateOperation.getProvisioningContext().setArtifactRepositories(repos); updateOperation.getProvisioningContext().setMetadataRepositories(repos); updateOperation.setSelectedUpdates(selectedUpdates); IStatus status = updateOperation.resolveModal(progress.newChild(1)); if (status.getSeverity() == IStatus.CANCEL) { throw new OperationCanceledException(); } else if (status.getSeverity() == IStatus.ERROR) { String message = status.getChildren()[0].getMessage(); UpdateMetaFileReaderJob.promptUserError(message, Messages.UpdateManager_27); log.error(Messages.UpdateManager_27 + message); } else { final ProvisioningJob provisioningJob = updateOperation.getProvisioningJob(progress.newChild(1)); if (provisioningJob != null) { provisioningJob.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJobChangeEvent arg0) { Display.getDefault().syncExec(new Runnable() { @Override public void run() { boolean restart = MessageDialog.openQuestion(Display.getDefault().getActiveShell(), Messages.UpdateManager_28, Messages.UpdateManager_29 + Messages.UpdateManager_30); if (restart) { PlatformUI.getWorkbench().restart(); } } }); } }); provisioningJob.schedule(); Display.getDefault().syncExec(new Runnable() { @Override public void run() { try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() .showView(IProgressConstants.PROGRESS_VIEW_ID); } catch (PartInitException e) { log.error(e); } } }); } else { log.error(Messages.UpdateManager_31); } } }
/** * Install selected features in to developer studio. Note: call * {@link #setSelectedFeaturesToInstall(List) setSelectedFeaturesToInstall} * first. * * @param monitor */ public void installSelectedFeatures(IProgressMonitor monitor) { SubMonitor progress = SubMonitor.convert(monitor, Messages.UpdateManager_32, 2); URI[] repos = new URI[] { getDevStudioReleaseSite() }; session = new ProvisioningSession(p2Agent); installOperation = new InstallOperation(session, selectedFeatures); installOperation.getProvisioningContext().setArtifactRepositories(repos); installOperation.getProvisioningContext().setMetadataRepositories(repos); IStatus status = installOperation.resolveModal(progress.newChild(1)); if (status.getSeverity() == IStatus.CANCEL || progress.isCanceled()) { throw new OperationCanceledException(); } else if (status.getSeverity() == IStatus.ERROR) { String message = status.getChildren()[0].getMessage(); log.error(Messages.UpdateManager_33 + message); UpdateMetaFileReaderJob.promptUserError(message, Messages.UpdateManager_33); } else { ProvisioningJob provisioningJob = installOperation.getProvisioningJob(progress.newChild(1)); if (provisioningJob != null) { provisioningJob.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJobChangeEvent arg0) { Display.getDefault().syncExec(new Runnable() { @Override public void run() { boolean restart = MessageDialog.openQuestion(Display.getDefault().getActiveShell(), Messages.UpdateManager_34, Messages.UpdateManager_35 + Messages.UpdateManager_36); if (restart) { PlatformUI.getWorkbench().restart(); } } }); } }); provisioningJob.schedule(); Display.getDefault().syncExec(new Runnable() { @Override public void run() { try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() .showView(IProgressConstants.PROGRESS_VIEW_ID); } catch (PartInitException e) { log.error(e); } } }); } else { log.error(Messages.UpdateManager_37); } } }
@Override public IStatus run(IProgressMonitor monitor) { currentProblem = null; monitor.beginTask("DynamicSpotter Diagnosis '" + project.getName() + "'", IProgressMonitor.UNKNOWN); ServiceClientWrapper client = Activator.getDefault().getClient(project.getName()); while (client.isRunning(true)) { if (monitor.isCanceled()) { return onUserCancelledJob(null); } Long currentJobId = client.getCurrentJobId(); // check if the job is still being processed if (currentJobId != null && currentJobId == jobId) { updateCurrentRun(client, monitor); try { Thread.sleep(SLEEP_TIME_MILLIS); } catch (InterruptedException e) { return onUserCancelledJob(e); } } else { // assume our job is due break; } } monitor.done(); boolean isConnectionIssue = client.isConnectionIssue(); Exception runException = client.getLastRunException(true); isConnectionIssue |= client.isConnectionIssue(); if (isConnectionIssue) { DialogUtils.openWarning(RunHandler.DIALOG_TITLE, MSG_LOST_CONNECTION); return new Status(Status.ERROR, Activator.PLUGIN_ID, Status.OK, MSG_LOST_CONNECTION, null); } if (runException != null) { // remove the job id because the job failed JobsContainer.removeJobId(project, jobId); String exceptionMsg = runException.getLocalizedMessage(); if (exceptionMsg == null || exceptionMsg.isEmpty()) { exceptionMsg = runException.getClass().getSimpleName(); } String msg = DialogUtils.appendCause(MSG_RUN_ERROR, exceptionMsg, true); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, msg, runException); } onFinishedJob(); // keep the finished job in the progress view only if // it is not running in the progress dialog Boolean inDialog = (Boolean) getProperty(IProgressConstants.PROPERTY_IN_DIALOG); if (inDialog != null && !inDialog.booleanValue()) { setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.TRUE); } return Status.OK_STATUS; }
@Override protected IStatus run(IProgressMonitor monitor) { currentProblem = null; monitor.beginTask("DynamicSpotter Diagnosis '" + project.getName() + "'", IProgressMonitor.UNKNOWN); ServiceClientWrapper client = Activator.getDefault().getClient(project.getName()); while (client.isRunning(true)) { if (monitor.isCanceled()) { return onUserCancelledJob(null); } Long currentJobId = client.getCurrentJobId(); // check if the job is still being processed if (currentJobId != null && currentJobId == jobId) { updateCurrentRun(client, monitor); try { Thread.sleep(SLEEP_TIME_MILLIS); } catch (InterruptedException e) { return onUserCancelledJob(e); } } else { // assume our job is due break; } } monitor.done(); boolean isConnectionIssue = client.isConnectionIssue(); Exception runException = client.getLastRunException(true); isConnectionIssue |= client.isConnectionIssue(); if (isConnectionIssue) { DialogUtils.openWarning(RunHandler.DIALOG_TITLE, MSG_LOST_CONNECTION); return new Status(Status.OK, Activator.PLUGIN_ID, Status.OK, MSG_LOST_CONNECTION, null); } onFinishedJob(runException); // keep the finished job in the progress view only if // it is not running in the progress dialog Boolean inDialog = (Boolean) getProperty(IProgressConstants.PROPERTY_IN_DIALOG); if (inDialog != null && !inDialog.booleanValue()) { setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.TRUE); } return Status.OK_STATUS; }
@Override public Object[] getElements(Object inputElement){ if (bValid || bUpdating) { return pats; } if (pfilter != null) { pats = new String[] { Messages.PatListeContentProvider_LoadingData }; ((TableViewer) viewer.getViewerWidget()).setItemCount(1); } if (!CoreHub.acl.request(AccessControlDefaults.PATIENT_DISPLAY)) { return new Object[0]; } Job job = new Job(Messages.PatListeContentProvider_LoadingPatients) { @Override protected IStatus run(IProgressMonitor monitor){ monitor.beginTask(Messages.PatListeContentProvider_LoadPatients, IProgressMonitor.UNKNOWN); if (pfilter != null) { if (pfilter.aboutToStart() == false) { return Status.CANCEL_STATUS; } } syncRefresh(); monitor.done(); return Status.OK_STATUS; } }; job.setPriority(Job.SHORT); job.setUser(false); bUpdating = true; IWorkbenchSiteProgressService siteService = (IWorkbenchSiteProgressService) site.getSite().getAdapter( IWorkbenchSiteProgressService.class); siteService.schedule(job, 0, true); job.setProperty(IProgressConstants.ICON_PROPERTY, Images.IMG_AUSRUFEZ_ROT.getImage()); return pats; }