当前位置: 首页>>代码示例>>Java>>正文


Java PartInitException类代码示例

本文整理汇总了Java中org.eclipse.ui.PartInitException的典型用法代码示例。如果您正苦于以下问题:Java PartInitException类的具体用法?Java PartInitException怎么用?Java PartInitException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PartInitException类属于org.eclipse.ui包,在下文中一共展示了PartInitException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import org.eclipse.ui.PartInitException; //导入依赖的package包/类
@Override
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
    if (!(input instanceof ProjectEditorInput)) {
        throw new PartInitException(Messages.ProjectEditorDiffer_error_bad_input_type);
    }

    ProjectEditorInput in = (ProjectEditorInput) input;
    Exception ex = in.getError();
    if (ex != null) {
        throw new PartInitException(in.getError().getLocalizedMessage(), ex);
    }

    setInput(input);
    setSite(site);
    setPartName(in.getName());

    proj = new PgDbProject(in.getProject());
    sp = new ProjectEditorSelectionProvider(proj.getProject());

    // message box
    if(!site.getPage().getPerspective().getId().equals(PERSPECTIVE.MAIN)){
        askPerspectiveChange(site);
    }
    getSite().setSelectionProvider(sp);
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:26,代码来源:ProjectEditorDiffer.java

示例2: openOutlineView

import org.eclipse.ui.PartInitException; //导入依赖的package包/类
protected void openOutlineView() throws PartInitException, InterruptedException {
	outlineView = editor.getEditorSite().getPage().showView("org.eclipse.ui.views.ContentOutline");
	executeAsyncDisplayJobs();
	Object adapter = editor.getAdapter(IContentOutlinePage.class);
	assertTrue(adapter instanceof OutlinePage);
	outlinePage = new SyncableOutlinePage((OutlinePage) adapter);
	outlinePage.resetSyncer();
	try {
		outlinePage.waitForUpdate(EXPECTED_TIMEOUT);
	} catch (TimeoutException e) {
		System.out.println("Expected timeout exceeded: " + EXPECTED_TIMEOUT);// timeout is OK here
	}
	treeViewer = outlinePage.getTreeViewer();
	assertSelected(treeViewer);
	assertExpanded(treeViewer);
	assertTrue(treeViewer.getInput() instanceof IOutlineNode);
	IOutlineNode rootNode = (IOutlineNode) treeViewer.getInput();
	List<IOutlineNode> children = rootNode.getChildren();
	assertEquals(1, children.size());
	modelNode = children.get(0);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:22,代码来源:AbstractOutlineWorkbenchTest.java

示例3: openXMLSequenceEditor

import org.eclipse.ui.PartInitException; //导入依赖的package包/类
public void openXMLSequenceEditor(IProject project) {
	Sequence sequence = getObject();
	
	IFile	file = project.getFile("_private/"+sequence.getName()+".xml");
	
	
	IWorkbenchPage activePage = PlatformUI
									.getWorkbench()
									.getActiveWorkbenchWindow()
									.getActivePage();
	if (activePage != null) {
		try {
			activePage.openEditor(new XMLSequenceEditorInput(file,sequence),
									"com.twinsoft.convertigo.eclipse.editors.xml.XMLSequenceEditor");
		}
		catch(PartInitException e) {
			ConvertigoPlugin.logException(e, "Error while loading the step editor '" + sequence.getName() + "'");
		} 
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:21,代码来源:SequenceTreeObject.java

示例4: openInbuiltOperationClass

import org.eclipse.ui.PartInitException; //导入依赖的package包/类
private void openInbuiltOperationClass(String operationName, PropertyDialogButtonBar propertyDialogButtonBar) {
	String operationClassName = null;
	Operations operations = XMLConfigUtil.INSTANCE.getComponent(FilterOperationClassUtility.INSTANCE.getComponentName())
			.getOperations();
	List<TypeInfo> typeInfos = operations.getStdOperation();
	for (int i = 0; i < typeInfos.size(); i++) {
		if (typeInfos.get(i).getName().equalsIgnoreCase(operationName)) {
			operationClassName = typeInfos.get(i).getClazz();
			break;
		}
	}
	propertyDialogButtonBar.enableApplyButton(true);
	javaProject = FilterOperationClassUtility.getIJavaProject();
	if (javaProject != null) {
		try {
			IType findType = javaProject.findType(operationClassName);
			JavaUI.openInEditor(findType);
		} catch (JavaModelException | PartInitException e) {
			Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID,Messages.CLASS_NOT_EXIST,null);
			StatusManager.getManager().handle(status, StatusManager.BLOCK);
			logger.error(e.getMessage(), e);
		}
	} else {
		WidgetUtility.errorMessage(Messages.SAVE_JOB_MESSAGE);
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:27,代码来源:ELTOpenFileEditorListener.java

示例5: testRunFinished

import org.eclipse.ui.PartInitException; //导入依赖的package包/类
/**
 * Called when all tests have finished
 *
 * @param result
 *            the summary of the test run, including all the tests that failed
 */
@Override
public void testRunFinished(Result result) throws Exception {
	Display.getDefault().syncExec(new Runnable() {
		@Override
		public void run() {

			IWorkbenchWindow[] windows = N4IDEXpectUIPlugin.getDefault().getWorkbench().getWorkbenchWindows();
			try {
				N4IDEXpectView view = (N4IDEXpectView) windows[0].getActivePage().showView(
						N4IDEXpectView.ID);
				view.notifySessionFinished();
			} catch (PartInitException e) {
				N4IDEXpectUIPlugin.logError("cannot refresh test view window", e);
			}
		}
	});
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:24,代码来源:N4IDEXpectRunListener.java

示例6: testFinished

import org.eclipse.ui.PartInitException; //导入依赖的package包/类
/**
 * Called when an atomic test has finished, whether the test succeeds or fails.
 *
 * @param description
 *            the description of the test that just ran
 */
@Override
public void testFinished(Description description) throws Exception {
	Display.getDefault().syncExec(new Runnable() {
		@Override
		public void run() {

			IWorkbenchWindow[] windows = N4IDEXpectUIPlugin.getDefault().getWorkbench().getWorkbenchWindows();
			try {
				N4IDEXpectView view = (N4IDEXpectView) windows[0].getActivePage().showView(
						N4IDEXpectView.ID);
				view.notifyFinishedExecutionOf(description);
			} catch (PartInitException e) {
				N4IDEXpectUIPlugin.logError("cannot refresh test view window", e);
			}
		}
	});
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:24,代码来源:N4IDEXpectRunListener.java

示例7: openXMLTransactionEditor

import org.eclipse.ui.PartInitException; //导入依赖的package包/类
public void openXMLTransactionEditor(IProject project) {
	Transaction transaction = (Transaction)this.getObject();
	
	IFile	file = project.getFile("_private/"+transaction.getName()+".xml");
	
	
	IWorkbenchPage activePage = PlatformUI
									.getWorkbench()
									.getActiveWorkbenchWindow()
									.getActivePage();
	if (activePage != null) {
		try {
			activePage.openEditor(new XMLTransactionEditorInput(file,transaction),
									"com.twinsoft.convertigo.eclipse.editors.xml.XMLTransactionEditor");
		} catch(PartInitException e) {
			ConvertigoPlugin.logException(e, "Error while loading the transaction editor '" + transaction.getName() + "'");
		} 
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:20,代码来源:TransactionTreeObject.java

示例8: execute

import org.eclipse.ui.PartInitException; //导入依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {

	IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(event);

	IWorkbenchWindow[] windows = N4IDEXpectUIPlugin.getDefault().getWorkbench().getWorkbenchWindows();
	try {
		view = (N4IDEXpectView) windows[0].getActivePage().showView(
				N4IDEXpectView.ID);
	} catch (PartInitException e) {
		N4IDEXpectUIPlugin.logError("cannot refresh test view window", e);
	}

	Description desc = (Description) selection.getFirstElement();
	if (desc.isTest() && view.testsExecutionStatus.hasFailed(desc)) {
		Throwable failureException = view.testsExecutionStatus.getFailure(desc).getException();

		if (failureException instanceof ComparisonFailure) {
			ComparisonFailure cf = (ComparisonFailure) failureException;
			// display comparison view
			displayComparisonView(cf, desc);
		}
	}
	return null;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:26,代码来源:XpectCompareCommandHandler.java

示例9: getConnectorEditor

import org.eclipse.ui.PartInitException; //导入依赖的package包/类
public IEditorPart getConnectorEditor(Connector connector) {
	IEditorPart editorPart = null;
	IWorkbenchPage activePage = getActivePage();
	if (activePage != null) {
		if (connector != null) {
			IEditorReference[] editorRefs = activePage.getEditorReferences();
			for (int i=0;i<editorRefs.length;i++) {
				IEditorReference editorRef = (IEditorReference)editorRefs[i];
				try {
					IEditorInput editorInput = editorRef.getEditorInput();
					if ((editorInput != null) && (editorInput instanceof ConnectorEditorInput)) {
						if (((ConnectorEditorInput)editorInput).is(connector)) {
							editorPart = editorRef.getEditor(false);
							break;
						}
					}
				}
				catch(PartInitException e) {
					//ConvertigoPlugin.logException(e, "Error while retrieving the connector editor '" + editorRef.getName() + "'");
				}
			}
		}
	}
	return editorPart;
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:26,代码来源:MyAbstractAction.java

示例10: init

import org.eclipse.ui.PartInitException; //导入依赖的package包/类
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
	super.init(site, input);
	setSite(site);
	setPartName(input.getName());
	setInputWithNotify(input);
	site.setSelectionProvider(this);
	if (getEditorInput() instanceof FileEditorInput) {
		FileEditorInput fei = (FileEditorInput) getEditorInput();
		IFile file = fei.getFile();
		gWGraph = ResourceManager.load(file);
		Display.getDefault().asyncExec(new Runnable() {
			@Override
			public void run() {
				gWGraph.initialize(getGraphicalViewer().getEditPartRegistry());
				if (!ResourceManager.isEditable(file)) {
					gWGraph.setReadOnly(true);
					getGraphicalViewer().getControl().setEnabled(false);
					String title = MessageUtil.getString("conversion");
					String message = MessageUtil.getString("not_formatted_as_json_convert_it");
					DialogManager.displayWarning(title, message);
				}
			}
		});
	}

}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:27,代码来源:GW4EEditor.java

示例11: run

import org.eclipse.ui.PartInitException; //导入依赖的package包/类
@Override
public void run() {
    if (isEnabled()) {
        try {
            ITextEditor editor = (ITextEditor) IDE.openEditor(
                    PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(),
                    segment.getParentFile(), EDITOR.SQL, true);
            editor.setHighlightRange(segment.offset, segment.length, true);
            editor.selectAndReveal(segment.offset, segment.length);
        } catch (PartInitException e) {
            Log.log(e);
            ExceptionNotifier.notifyDefault(Messages.PgNavigatorActionProvider_failed_to_open_editor, e);
        }
    }
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:16,代码来源:NavigatorOutlineActionProvider.java

示例12: getApplicationComponentEditor

import org.eclipse.ui.PartInitException; //导入依赖的package包/类
public IEditorPart getApplicationComponentEditor() {
	IEditorPart editorPart = null;
	IWorkbenchPage activePage = getActivePage();
	if (activePage != null) {
		IEditorReference[] editorRefs = activePage.getEditorReferences();
		for (int i=0;i<editorRefs.length;i++) {
			IEditorReference editorRef = (IEditorReference)editorRefs[i];
			try {
				IEditorInput editorInput = editorRef.getEditorInput();
				if ((editorInput != null) && (editorInput instanceof ApplicationComponentEditorInput)) {
					editorPart = editorRef.getEditor(false);
					break;
				}
			}
			catch(PartInitException e) {
				//ConvertigoPlugin.logException(e, "Error while retrieving the connector editor '" + editorRef.getName() + "'");
			}
		}
	}
	return editorPart;
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:22,代码来源:ConvertigoPlugin.java

示例13: testCloseEditor

import org.eclipse.ui.PartInitException; //导入依赖的package包/类
@Test
public void testCloseEditor() throws Exception {
	
	IJavaProject project = ProjectHelper.getOrCreateSimpleGW4EProject(PROJECT_NAME, true, true);
	IFile impl = (IFile) ResourceManager
			.getResource(project.getProject().getFullPath().append("src/test/java/SimpleImpl.java").toString());
	Display.getDefault().syncExec(() -> {
		try {
			IWorkbenchWindow iww = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
			ResourceManager.closeEditor(impl, iww);
		} catch (PartInitException e) {
			ResourceManager.logException(e);
		}});
	 
	Waiter.waitUntil(new EditorClosedCondition("SimpleImpl.java"));
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:17,代码来源:ResourceManagerTest.java

示例14: focusMarker

import org.eclipse.ui.PartInitException; //导入依赖的package包/类
public static void focusMarker(final IMarker marker) {
  Display.getDefault().syncExec(new Runnable() {

    @Override
    public void run() {
      try {
        IDE.openEditor(
            MarkerActivator.getDefault().getWorkbench().getWorkbenchWindows()[0].getActivePage(),
            marker);
      } catch (final PartInitException e1) {

        e1.printStackTrace();
      }
    }
  });
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:17,代码来源:MarkUtilities.java

示例15: getOpenEditorOfMarker

import org.eclipse.ui.PartInitException; //导入依赖的package包/类
/**
 * Note: it compares marker's resource file name and open editors' file name.
 *
 * @param marker
 * @return if marker's editor is open, return editor, else return null
 */
public static IEditorPart getOpenEditorOfMarker(final IMarker marker) {
  final IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
  for (final IWorkbenchWindow iWorkbenchWindow : windows) {
    final IWorkbenchPage[] pages = iWorkbenchWindow.getPages();
    for (final IWorkbenchPage iWorkbenchPage : pages) {
      final IEditorReference[] editors = iWorkbenchPage.getEditorReferences();
      for (final IEditorReference iEditorReference : editors) {
        try {
          if (iEditorReference instanceof IFileEditorInput) {
            final IFileEditorInput input = (IFileEditorInput) iEditorReference.getEditorInput();
            final IFile file = input.getFile();
            // TODO Caused by: java.lang.NullPointerException when delete marker on ecore editor.
            if (file.getFullPath().equals(marker.getResource().getFullPath())) {
              return iEditorReference.getEditor(false);
            }
          }
        } catch (final PartInitException e) {
          e.printStackTrace();
        }
      }
    }
  }
  return null;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:31,代码来源:MarkerFactory.java


注:本文中的org.eclipse.ui.PartInitException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。