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


Java EditorPart类代码示例

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


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

示例1: isTimelineActive

import org.eclipse.ui.part.EditorPart; //导入依赖的package包/类
public static boolean isTimelineActive() {
	IWorkbench workbench = Activator.getDefault().getWorkbench();
	IEditorPart current = EditorPartUtils.getCurrent(workbench);
	if (current instanceof EditorPart) {
		IEditorPart activeEditor = current;
		if (activeEditor instanceof MultiPageEditorPart) {
			MultiPageEditorPart editor = (MultiPageEditorPart) current;
			int activePage = editor.getActivePage();
			if (activePage >= 0) {
				IEditorPart[] subEditors = editor.findEditors(editor.getEditorInput());
				if (activePage < subEditors.length) {
					activeEditor = subEditors[activePage];
				}
			}
		}
		Object adapter = activeEditor.getAdapter(Timeline.class);
		if (adapter != null) {
			return true;
		}
	}
	return false;
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:23,代码来源:AbstractTimelineCommandHandler.java

示例2: partActivated

import org.eclipse.ui.part.EditorPart; //导入依赖的package包/类
@Override
public void partActivated(IWorkbenchPart part) {
	if (part instanceof IEditorPart) {
		if (((IEditorPart) part).getEditorInput() instanceof IFileEditorInput) {
			IFile file = ((IFileEditorInput) ((EditorPart) part)
					.getEditorInput()).getFile();
			System.out
					.println("\n====== LOCATION OF ACTIVE FILE IN EDITOR ======");
			System.out.println(file.getLocation());
			System.out
					.println("===============================================");
			MarkerHandler.getInstance().refreshMarker(file);
			cc.setBaseVersion(file);
		}
	}
}
 
开发者ID:1Tristan,项目名称:VariantSync,代码行数:17,代码来源:PartAdapter.java

示例3: activateContext

import org.eclipse.ui.part.EditorPart; //导入依赖的package包/类
public void activateContext(String featureExpression) {
	if (!isPartActivated) {
		IWorkbench wb = PlatformUI.getWorkbench();
		IWorkbenchWindow win = wb.getActiveWorkbenchWindow();
		IWorkbenchPage page = win.getActivePage();
		IWorkbenchPart part = page.getActivePart();
		if (part instanceof IEditorPart) {
			if (((IEditorPart) part).getEditorInput() instanceof IFileEditorInput) {
				IFile file = ((IFileEditorInput) ((EditorPart) part)
						.getEditorInput()).getFile();
				System.out
						.println("\n====== LOCATION OF ACTIVE FILE IN EDITOR ======");
				System.out.println(file.getLocation());
				System.out
						.println("===============================================");
				MarkerHandler.getInstance().refreshMarker(file);
				setBaseVersion(file);
			}
		}
	}
	contextOperations.activateContext(featureExpression);
}
 
开发者ID:1Tristan,项目名称:VariantSync,代码行数:23,代码来源:ContextController.java

示例4: onLoad

import org.eclipse.ui.part.EditorPart; //导入依赖的package包/类
public void onLoad(final JasperDesign jd, final EditorPart editor) {
	if (!(editor instanceof JrxmlEditor))
		return;
	String prop = jd.getProperty(AExporter.PROP_SERVERURL);
	if (prop == null)
		return;
	JrxmlEditor jEditor = (JrxmlEditor) editor;
	JasperReportsConfiguration jConfig = jEditor.getJrContext(null);
	JSSFileRepositoryService repService = jConfig.getFileRepositoryService();
	List<RepositoryService> rservices = repService.getRepositoryServices();
	List<RepositoryService> toDel = new ArrayList<RepositoryService>();
	for (RepositoryService rs : rservices)
		if (rs instanceof JRSRepositoryService) {
			toDel.add(rs);
			FileRepositoryService frs = ((JRSRepositoryService) rs).getFileRepositoryService();
			if (frs != null)
				toDel.add(frs);
		}
	rservices.removeAll(toDel);
	rservices.add(new JRSRepositoryService(repService, jConfig));
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:22,代码来源:JRSEditorContributor.java

示例5: partActivated

import org.eclipse.ui.part.EditorPart; //导入依赖的package包/类
@Override
public void partActivated(IWorkbenchPart part) {
	if (part instanceof EditorPart) {
		EditorPart editorPart = (EditorPart) part;
		if (editorPart.getEditorInput() instanceof URIEditorInput) {
			URIEditorInput input = (URIEditorInput) editorPart.getEditorInput();
			updateView(input.getURI());
			if(txtMessage != null){
				txtMessage.setEnabled(true);
			}
		} else {
			if(txtMessage != null){
				txtMessage.setEnabled(false);
			}
			txtMessagePool.setText("Message Pool");
		}
	}
}
 
开发者ID:FTSRG,项目名称:mondo-collab-framework,代码行数:19,代码来源:WhiteboardGenericView.java

示例6: getDesignerProjectForEditor

import org.eclipse.ui.part.EditorPart; //导入依赖的package包/类
/**
 * This method will get the DesignerProject for the current XPage and return it. 
 * @param compEditor
 * @return
 */
private DesignerProject getDesignerProjectForEditor(CompositeEditor compEditor){
    IWorkbenchPart part = super.getWorkBenchPart();
    if(part instanceof EditorPart){
        EditorPart editor = (EditorPart)part;
        IEditorInput input = editor.getEditorInput();
        if(input instanceof IFileEditorInput){
            IFileEditorInput fileInput = (IFileEditorInput)input;
            IFile xpageFile = fileInput.getFile();
            if(null != xpageFile){
                IProject project = xpageFile.getProject();
                if(null != project){
                    DesignerProject designerProj = DesignerResource.getDesignerProject(project);
                    if(null != designerProj){
                        return designerProj;
                    }
                }
            }
        }
    }
    return null;
}
 
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:27,代码来源:AbstractDesignElementPicker.java

示例7: loadEditor

import org.eclipse.ui.part.EditorPart; //导入依赖的package包/类
private void loadEditor() throws PartInitException
{
	try
	{
		IDatabaseDescriptor<?> descriptor = DatabasePlugin.getDescriptor(table.getName());
		if (descriptor.getEditorID() != null)
		{
	        IConfigurationElement[] elements = Platform.getExtensionRegistry().
	        		getConfigurationElementsFor("org.eclipse.ui.editors");
			for(IConfigurationElement conf : elements)
			{
				if (conf.getAttribute("id").equals(descriptor.getEditorID()))
				{
					Bundle plugin = Platform.getBundle(conf.getContributor().getName());
					
					this.editorClass = (Class<EditorPart>) plugin.loadClass(conf.getAttribute("class"));
					return;
				}
			}
		}
	}
	catch (Exception e)
	{
		throwPartInitException(e);
	}
}
 
开发者ID:TheWhiteShadow3,项目名称:cuina,代码行数:27,代码来源:DatabaseEditor.java

示例8: partActivated

import org.eclipse.ui.part.EditorPart; //导入依赖的package包/类
@Override
public void partActivated(IWorkbenchPart part) {
	Shell shell= PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
	IEditorReference[] editorReference= PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences();
	
	if(part instanceof EditorPart){
		if(shell != null){
		shell.setText(windowTitlePrefix+((EditorPart)part).getTitleToolTip()+windowTitleSuffix);
		}
	}else{
		if(editorReference!=null && editorReference.length==0){
			shell.setText(windowTitleDefault);
		} 
	}
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:16,代码来源:TitleBarPartListener.java

示例9: initRetargetActions

import org.eclipse.ui.part.EditorPart; //导入依赖的package包/类
public void initRetargetActions(final EditorPart newEditor) {
    final Iterator iter = getActionRegistry().getActions();

    while (iter.hasNext()) {
        final IAction action = (IAction) iter.next();
        if (action instanceof RetargetAction) {
            ((RetargetAction) action).partActivated(newEditor);
        }
    }
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:11,代码来源:ERDiagramActionBarContributor.java

示例10: initRetargetActions

import org.eclipse.ui.part.EditorPart; //导入依赖的package包/类
public void initRetargetActions(EditorPart newEditor) {
	Iterator iter = this.getActionRegistry().getActions();

	while (iter.hasNext()) {
		IAction action = (IAction) iter.next();
		if (action instanceof RetargetAction) {
			((RetargetAction) action).partActivated(newEditor);
		}
	}
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:11,代码来源:ERDiagramActionBarContributor.java

示例11: ReportContainer

import org.eclipse.ui.part.EditorPart; //导入依赖的package包/类
/**
 * Instantiates a new report container.
 * 
 * @param parent
 *          the parent
 */
public ReportContainer(EditorPart parent, JasperReportsConfiguration jrContext) {
	this.parent = parent;
	this.jrContext = jrContext;
	this.selectionCache = new CommonSelectionCacheProvider();
	//Store the selection cache
	jrContext.put(SELECTION_CACHE_KEY, selectionCache);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:14,代码来源:ReportContainer.java

示例12: EditorPartInputActivationListener

import org.eclipse.ui.part.EditorPart; //导入依赖的package包/类
/**
 * Creates this activation listener.
 *
 * @param editor the part service on which to add the part listener
 * @since 3.1
 */
public EditorPartInputActivationListener(EditorPart editor) {
	fEditor= editor;
	fPartService= editor.getSite().getWorkbenchWindow().getPartService();
	fPartService.addPartListener(this);
	PlatformUI.getWorkbench().addWindowListener(this);
	ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE);		
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:14,代码来源:EditorPartInputActivationListener.java

示例13: propertyChanged

import org.eclipse.ui.part.EditorPart; //导入依赖的package包/类
@Override
public void propertyChanged(Object source, int propId)
{
	if (EditorPart.PROP_DIRTY == propId) {
		setDirty(true);
	}
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:8,代码来源:ConfigAlternative.java

示例14: propertyChanged

import org.eclipse.ui.part.EditorPart; //导入依赖的package包/类
@Override
public void propertyChanged(Object source, int propId)
{
	if (EditorPart.PROP_DIRTY == propId)
	{
		setDirty(true);
	}
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:9,代码来源:InputAlternative.java

示例15: doSaveAs

import org.eclipse.ui.part.EditorPart; //导入依赖的package包/类
/**
 * 
 * @see org.eclipse.ui.part.EditorPart#doSaveAs()
 */
public void doSaveAs() {
	/* First, check if the tree has no structural errors. */
	if (!checkTree()) {
		StandardDialogs.errorDialog("Tree not saved",
				"Errors were detected while validating the tree");
		return;
	}

	SaveBTAsAction action = new SaveBTAsAction(this.tree, this.getEditorInput().getName());

	try {
		action.run();
		if (action.getSelectedFile() != null) {
			BTEditorInput editorInput = (BTEditorInput) getEditorInput();
			editorInput.setTreeName(action.getSelectedFile());
			this.dirty = false;
			setIsFromFile(true);

			/*
			 * If the tree comes from a guard, it must be dissociated from
			 * its original tree. From then on, this BTEditor will be
			 * managed as a normal BTEditor.
			 */
			if (isFromGuard()) {
				dissociateFromParentTree();
			}

			setPartName(editorInput.getName());

			firePropertyChange(EditorPart.PROP_DIRTY);
			firePropertyChange(PROP_TITLE);
		}
	} catch (Exception e) {
		StandardDialogs.exceptionDialog("Error saving the tree",
				"There was an error when saving the tree", e);
	}
}
 
开发者ID:gaia-ucm,项目名称:jbt,代码行数:42,代码来源:BTEditor.java


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