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


Java IEditorReference.getEditorInput方法代码示例

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


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

示例1: closeConnectorEditors

import org.eclipse.ui.IEditorReference; //导入方法依赖的package包/类
public void closeConnectorEditors() {
	IWorkbenchPage activePage = PlatformUI
									.getWorkbench()
									.getActiveWorkbenchWindow()
									.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 ConnectorEditorInput)) {
					if (((ConnectorEditorInput)editorInput).is(getObject()))
						activePage.closeEditor(editorRef.getEditor(false),true);
				}
			}
			catch(PartInitException e) {
				ConvertigoPlugin.logException(e, "Error while retrieving the connector editor '" + editorRef.getName() + "'");
			}
		}
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:23,代码来源:ProjectTreeObject.java

示例2: closeSequenceEditors

import org.eclipse.ui.IEditorReference; //导入方法依赖的package包/类
public void closeSequenceEditors(Sequence sequence) {
	IWorkbenchPage activePage = PlatformUI
									.getWorkbench()
									.getActiveWorkbenchWindow()
									.getActivePage();
	if (activePage != null) {
		if (sequence != 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 SequenceEditorInput)) {
						if (((SequenceEditorInput)editorInput).is(sequence)) {
							activePage.closeEditor(editorRef.getEditor(false),true);
							break;
						}
					}
				}
				catch(PartInitException e) {
					ConvertigoPlugin.logException(e, "Error while retrieving the sequence editor '" + editorRef.getName() + "'");
				}
			}
		}
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:27,代码来源:ProjectTreeObject.java

示例3: getConnectorEditor

import org.eclipse.ui.IEditorReference; //导入方法依赖的package包/类
private IEditorPart getConnectorEditor(IWorkbenchPage activePage, Connector connector) {
	IEditorPart editorPart = null;
	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,代码行数:25,代码来源:ConnectorTreeObject.java

示例4: closeComponentFileEditor

import org.eclipse.ui.IEditorReference; //导入方法依赖的package包/类
private void closeComponentFileEditor(final IFile file) {
	try {
		IWorkbenchPage activePage = PlatformUI
				.getWorkbench()
				.getActiveWorkbenchWindow()
				.getActivePage();
		
		for (IEditorReference editorReference : activePage.getEditorReferences()) {
			IEditorInput editorInput = editorReference.getEditorInput();
			if (editorInput instanceof ComponentFileEditorInput) {
				ComponentFileEditorInput cfei = (ComponentFileEditorInput) editorInput;
				if (cfei.getFile().equals(file)) {
					activePage.closeEditor(editorReference.getEditor(false), true);
					return;
				}
			}
		}
	} catch (Exception e) {
		
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:22,代码来源:MobileUIComponentTreeObject.java

示例5: getConnectorEditor

import org.eclipse.ui.IEditorReference; //导入方法依赖的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,代码行数:27,代码来源:TraceTreeObject.java

示例6: closeAllEditors

import org.eclipse.ui.IEditorReference; //导入方法依赖的package包/类
@Override
public void closeAllEditors(boolean save) {
	super.closeAllEditors(save);// will close any child component editor
	
	ApplicationComponent application = (ApplicationComponent) getObject();
	synchronized (application) {
		IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().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) {
						if (((ApplicationComponentEditorInput) editorInput).is(application)) {
							activePage.closeEditor(editorRef.getEditor(false),false);
						}
					}
				} catch(Exception e) {
					
				}
			}
		}
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:26,代码来源:MobileApplicationComponentTreeObject.java

示例7: closeAllEditors

import org.eclipse.ui.IEditorReference; //导入方法依赖的package包/类
public void closeAllEditors(boolean save) {
	MobileComponent mc = getObject();
	
	IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().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 ComponentFileEditorInput) {
					if (((ComponentFileEditorInput)editorInput).is(mc) ||
						((ComponentFileEditorInput)editorInput).isChildOf(mc)) {
							activePage.closeEditor(editorRef.getEditor(false),save);
					}
				}
			} catch(Exception e) {
				
			}
		}
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:23,代码来源:MobileComponentTreeObject.java

示例8: getSequenceEditor

import org.eclipse.ui.IEditorReference; //导入方法依赖的package包/类
private IEditorPart getSequenceEditor(IWorkbenchPage activePage, Sequence sequence) {
	IEditorPart editorPart = null;
	if (activePage != null) {
		if (sequence != 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 SequenceEditorInput)) {
						if (((SequenceEditorInput)editorInput).is(sequence)) {
							editorPart = editorRef.getEditor(false);
							break;
						}
					}
				} catch(PartInitException e) {
					//ConvertigoPlugin.logException(e, "Error while retrieving the sequence editor '" + editorRef.getName() + "'");
				}
			}
		}
	}
	return editorPart;
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:24,代码来源:SequenceTreeObject.java

示例9: getConnectorEditor

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

import org.eclipse.ui.IEditorReference; //导入方法依赖的package包/类
public IEditorPart getJscriptTransactionEditor(Transaction transaction) {
	IEditorPart editorPart = null;
	IWorkbenchPage activePage = getActivePage();
	if (activePage != null) {
		if (transaction != 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 JscriptTransactionEditorInput)) {
						if (((JscriptTransactionEditorInput)editorInput).transaction.equals(transaction)) {
							editorPart = editorRef.getEditor(false);
							break;
						}
					}
				}
				catch(PartInitException e) {
					//ConvertigoPlugin.logException(e, "Error while retrieving the jscript transaction editor '" + editorRef.getName() + "'");
				}
			}
		}
	}
	return editorPart;
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:26,代码来源:MyAbstractAction.java

示例11: getJscriptTransactionEditor

import org.eclipse.ui.IEditorReference; //导入方法依赖的package包/类
/**
 * Gets the jscript editor associated with given transaction.
 * !!MUST BE CALLED IN A UI-THREAD!!
 * @return IEditorPart : the found jscript editor or null
 */
public IEditorPart getJscriptTransactionEditor(Transaction transaction) {
	IEditorPart editorPart = null;
	IWorkbenchPage activePage = getActivePage();
	if (activePage != null) {
		if (transaction != 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 JscriptTransactionEditorInput)) {
						if (((JscriptTransactionEditorInput)editorInput).transaction.equals(transaction)) {
							editorPart = editorRef.getEditor(false);
							break;
						}
					}
				}
				catch(PartInitException e) {
					//ConvertigoPlugin.logException(e, "Error while retrieving the jscript transaction editor '" + editorRef.getName() + "'");
				}
			}
		}
	}
	return editorPart;
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:31,代码来源:ConvertigoPlugin.java

示例12: getApplicationComponentEditor

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

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

示例14: needsToSaveDirtyEditors

import org.eclipse.ui.IEditorReference; //导入方法依赖的package包/类
/**
 * Most SVN workspace actions modify the workspace and thus should
 * save dirty editors.
 * @see org.tigris.subversion.subclipse.ui.actions.SVNAction#needsToSaveDirtyEditors()
 */
protected boolean needsToSaveDirtyEditors() {

	IResource[] selectedResources = getSelectedResources();
	if (selectedResources != null && selectedResources.length > 0) {
		IEditorReference[] editorReferences = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences();
		for (IEditorReference editorReference : editorReferences) {
			if (editorReference.isDirty()) {
				try {
					IEditorInput editorInput = editorReference.getEditorInput();
					if (editorInput instanceof IFileEditorInput) {
						IFile file = ((IFileEditorInput)editorInput).getFile();
						if (needsToSave(file, selectedResources)) {
							return true;
						}
					}
				} catch (PartInitException e) {}
			}
		}
	}
	
	return false;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:28,代码来源:WorkspaceAction.java

示例15: matches

import org.eclipse.ui.IEditorReference; //导入方法依赖的package包/类
/**
 * @generated
 */
public boolean matches(IEditorReference editorRef, IEditorInput input) {
	IEditorInput editorInput;
	try {
		editorInput = editorRef.getEditorInput();
	} catch (PartInitException e) {
		return false;
	}

	if (editorInput.equals(input)) {
		return true;
	}
	if (editorInput instanceof URIEditorInput
			&& input instanceof URIEditorInput) {
		return ((URIEditorInput) editorInput).getURI().equals(
				((URIEditorInput) input).getURI());
	}
	return false;
}
 
开发者ID:spoenemann,项目名称:xtext-gef,代码行数:22,代码来源:StatemachineMatchingStrategy.java


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