本文整理汇总了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() + "'");
}
}
}
示例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);
}
示例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;
}
示例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() + "'");
}
}
}
示例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() + "'");
}
}
}
}
示例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() + "'");
}
}
}
}
示例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;
}
示例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 + "'");
}
}
}
示例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.");
}
}
}
示例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() + "'");
}
}
}
示例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() + "'");
}
}
}
示例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() + "'");
}
}
}
}
}
示例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 + "'");
}
}
}
示例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));
}
}
}
示例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 () );
}
}