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


Java IWorkbenchPage.openEditor方法代码示例

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


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

示例1: openJscriptTransactionEditor

import org.eclipse.ui.IWorkbenchPage; //导入方法依赖的package包/类
public void openJscriptTransactionEditor(IProject project) {
	Transaction transaction = (Transaction)this.getObject();
	
	String tempFileName = 	"_private/"+project.getName()+
							"__"+transaction.getConnector().getName()+
							"__"+transaction.getName();
	
	IFile file = project.getFile(tempFileName);

	IWorkbenchPage activePage = PlatformUI
									.getWorkbench()
									.getActiveWorkbenchWindow()
									.getActivePage();
	if (activePage != null) {
		try {
			activePage.openEditor(new JscriptTransactionEditorInput(file,transaction),
									"com.twinsoft.convertigo.eclipse.editors.jscript.JscriptTransactionEditor");
		} catch(PartInitException e) {
			ConvertigoPlugin.logException(e, "Error while loading the transaction editor '" + transaction.getName() + "'");
		} 
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:23,代码来源:TransactionTreeObject.java

示例2: editFile

import org.eclipse.ui.IWorkbenchPage; //导入方法依赖的package包/类
public static IEditorPart editFile(File file, boolean preferIdeEditor) throws IOException, PartInitException {

        if (file == null || !file.exists() || !file.isFile() || !file.canRead()) {
            throw new IOException("Invalid file: '" + file + "'");
        }

        IWorkbench workBench = PlatformUI.getWorkbench();
        IWorkbenchPage page = workBench.getActiveWorkbenchWindow().getActivePage();
        IPath location = Path.fromOSString(file.getAbsolutePath());

        IFileStore fileStore = EFS.getLocalFileSystem().getStore(location);
        FileStoreEditorInput fileStoreEditorInput = new FileStoreEditorInput(fileStore);

        String editorId = IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID;
        if (preferIdeEditor) {
            IEditorDescriptor editorDescriptor = workBench.getEditorRegistry().getDefaultEditor(file.getName());
            if (editorDescriptor != null) {
                editorId = editorDescriptor.getId();
            }
        }

        return page.openEditor(fileStoreEditorInput, editorId);
    }
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:24,代码来源:FileEditor.java

示例3: execute

import org.eclipse.ui.IWorkbenchPage; //导入方法依赖的package包/类
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
	IFile file = getSelectedFile();
	if (file==null){
		return null;
	}
	IWorkbenchPage page = EclipseUtil.getActivePage();
	if (page==null){
		return null;
	}
	try {
		page.openEditor(new FileEditorInput(file), BashEditor.EDITOR_ID);
	} catch (PartInitException e) {
		throw new ExecutionException("Was not able to open bash editor for file:"+file.getName(),e);
	}
	return null;
}
 
开发者ID:de-jcup,项目名称:eclipse-bash-editor,代码行数:18,代码来源:OpenWithBashEditor.java

示例4: openXMLSequenceStepEditor

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

示例5: openConnectorEditors

import org.eclipse.ui.IWorkbenchPage; //导入方法依赖的package包/类
public void openConnectorEditors() {
	IWorkbenchPage activePage = PlatformUI
									.getWorkbench()
									.getActiveWorkbenchWindow()
									.getActivePage();
	if (activePage != null) {
		List<Connector> vConnectors = getObject().getConnectorsList();
		for (Connector connector : vConnectors) {
			try {
				activePage.openEditor(new ConnectorEditorInput(connector),
						"com.twinsoft.convertigo.eclipse.editors.connector.ConnectorEditor");
			}
			catch(PartInitException e) {
				ConvertigoPlugin.logException(e, "Error while loading the connector editor '" + connector.getName() + "'");
			}
		}
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:19,代码来源:ProjectTreeObject.java

示例6: openConnectorEditor

import org.eclipse.ui.IWorkbenchPage; //导入方法依赖的package包/类
public void openConnectorEditor(Connector connector) {
	IWorkbenchPage activePage = PlatformUI
									.getWorkbench()
									.getActiveWorkbenchWindow()
									.getActivePage();
	if (activePage != null) {
		if (connector != null) {
			try {
				activePage.openEditor(new ConnectorEditorInput(connector),
						"com.twinsoft.convertigo.eclipse.editors.connector.ConnectorEditor");
			}
			catch(PartInitException e) {
				ConvertigoPlugin.logException(e, "Error while loading the connector editor '" + connector.getName() + "'");
			}
		}
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:18,代码来源:ProjectTreeObject.java

示例7: open

import org.eclipse.ui.IWorkbenchPage; //导入方法依赖的package包/类
@Override
public boolean open(ScanBean scanBean) throws Exception {
	if (scanBean.getFilePath() == null) {
		return false;
	}

	if (!scanBean.getStatus().isFinal() && !confirmOpen(scanBean)) {
		return false;
	}

	String filePath = scanBean.getFilePath();
	IWorkbench workbench = PlatformUI.getWorkbench();
	IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();

	// Set the perspective to Data Browsing Perspective
	// TODO FIXME When there is a general data viewing perspective from DAWN, use that.
	workbench.showPerspective(DATA_PERSPECTIVE_ID, window);
	String editorId = getEditorId(filePath);
	IEditorInput editorInput = getEditorInput(filePath);
	IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
	page.openEditor(editorInput, editorId);
	return true;
}
 
开发者ID:eclipse,项目名称:scanning,代码行数:24,代码来源:DefaultScanResultsHandler.java

示例8: openXslEditor

import org.eclipse.ui.IWorkbenchPage; //导入方法依赖的package包/类
public void openXslEditor(IProject project) {
	Sheet sheet = getObject();
	String projectName = sheet.getProject().getName();
	String parentStyleSheet = sheet.getUrl();
	Path filePath = new Path(sheet.getUrl());
	IFile file = project.getFile(filePath);
	
	IWorkbenchPage activePage = PlatformUI
									.getWorkbench()
									.getActiveWorkbenchWindow()
									.getActivePage();
	if (activePage != null) {
		try {
			activePage.openEditor(new XslFileEditorInput(file, projectName, sheet),
					"com.twinsoft.convertigo.eclipse.editors.xsl.XslRuleEditor");
		}
		catch(PartInitException e) {
			ConvertigoPlugin.logException(e, "Error while loading the xsl editor '" + parentStyleSheet + "'");
		}
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:22,代码来源:SheetTreeObject.java

示例9: openTextEditor

import org.eclipse.ui.IWorkbenchPage; //导入方法依赖的package包/类
public void openTextEditor(IProject project) {
	
	ConnectorTreeObject connectorTreeObject = (ConnectorTreeObject)this.parent.parent;
	
	IFile file = project.getFile("Traces/"+ connectorTreeObject.getName() + "/" + this.getName());
	
	IWorkbenchPage activePage = PlatformUI
									.getWorkbench()
									.getActiveWorkbenchWindow()
									.getActivePage();
	if (activePage != null) {
		try {
			activePage.openEditor(new TraceFileEditorInput(connectorTreeObject.getObject(), file),"org.eclipse.ui.DefaultTextEditor");
		} catch(PartInitException e) {
			ConvertigoPlugin.logException(e, "Error while loading the text editor.");
		}
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:19,代码来源:TraceTreeObject.java

示例10: openJscriptStatementEditor

import org.eclipse.ui.IWorkbenchPage; //导入方法依赖的package包/类
private void openJscriptStatementEditor(IProject project) {
	Statement statement = this.getObject();

	IFile file = project.getFile("/_private/" + statement.getQName() + " " + statement.getName());

	IWorkbenchPage activePage = PlatformUI
									.getWorkbench()
									.getActiveWorkbenchWindow()
									.getActivePage();
	if (activePage != null) {
		try {
			activePage.openEditor(new JscriptStatementEditorInput(file, statement),
									"com.twinsoft.convertigo.eclipse.editors.jscript.JscriptStatementEditor");
		}
		catch(PartInitException e) {
			ConvertigoPlugin.logException(e, "Error while loading the statement editor '" + statement.getName() + "'");
		} 
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:20,代码来源:StatementTreeObject.java

示例11: openXMLTransactionEditor

import org.eclipse.ui.IWorkbenchPage; //导入方法依赖的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

示例12: openSequenceEditor

import org.eclipse.ui.IWorkbenchPage; //导入方法依赖的package包/类
public void openSequenceEditor() {
	Sequence sequence = getObject();
	synchronized (sequence) {
		IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
		if (activePage != null) {
			IEditorPart editorPart = getSequenceEditor(activePage, sequence);
			
			if (editorPart != null) {
				activePage.activate(editorPart);
			}
			else {
				try {
					editorPart = activePage.openEditor(new SequenceEditorInput(sequence),
									"com.twinsoft.convertigo.eclipse.editors.sequence.SequenceEditor");
				} catch (PartInitException e) {
					ConvertigoPlugin.logException(e,
							"Error while loading the sequence editor '"
									+ sequence.getName() + "'");
				}
			}
		}
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:24,代码来源:SequenceTreeObject.java

示例13: openJscriptHandlerEditor

import org.eclipse.ui.IWorkbenchPage; //导入方法依赖的package包/类
public void openJscriptHandlerEditor(IProject project) {
	String tempFileName = getTempFileName(project);
	
	IFile file = project.getFile(tempFileName);
	
	IWorkbenchPage activePage = PlatformUI
							.getWorkbench()
							.getActiveWorkbenchWindow()
							.getActivePage();
	
	if (activePage != null) {
		try {
			activePage.openEditor(new JscriptTreeFunctionEditorInput(file,this),
									"com.twinsoft.convertigo.eclipse.editors.jscript.JscriptTreeFunctionEditor");
		} catch(PartInitException e) {
			ConvertigoPlugin.logException(e, "Error while loading the document editor '" + tempFileName + "'");
		} 
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:20,代码来源:DesignDocumentFunctionTreeObject.java

示例14: openJobInEditor

import org.eclipse.ui.IWorkbenchPage; //导入方法依赖的package包/类
private void openJobInEditor(IWorkbenchPage page, ELTGraphicalEditorInput input) throws PartInitException {
	page.openEditor(input, ELTGraphicalEditor.ID, true);
	IWorkbench workbench = PlatformUI.getWorkbench();
	IWorkbenchWindow activeWindow = workbench.getActiveWorkbenchWindow();
	if (activeWindow != null) {
		final IWorkbenchPage activePage = activeWindow.getActivePage();
		if (activePage != null) {
			activePage.activate(activePage.findEditor(input));
		}
	}
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:13,代码来源:JobCreationPage.java

示例15: handleOpen

import org.eclipse.ui.IWorkbenchPage; //导入方法依赖的package包/类
public static void handleOpen ( final IWorkbenchPage page, final String connectionId, final String factoryId, final String configurationId )
{
    try
    {
        page.openEditor ( new ConfigurationEditorInput ( connectionId, factoryId, configurationId ), MultiConfigurationEditor.EDITOR_ID, true );
    }
    catch ( final PartInitException e )
    {
        StatusManager.getManager ().handle ( e.getStatus () );
    }
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:12,代码来源:EditorHelper.java


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