本文整理汇总了Java中org.eclipse.jdt.ui.actions.OpenAction类的典型用法代码示例。如果您正苦于以下问题:Java OpenAction类的具体用法?Java OpenAction怎么用?Java OpenAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OpenAction类属于org.eclipse.jdt.ui.actions包,在下文中一共展示了OpenAction类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createActions
import org.eclipse.jdt.ui.actions.OpenAction; //导入依赖的package包/类
private void createActions() {
// For the following commands we use actions, as they are already available
final IActionBars ab = getViewSite().getActionBars();
openAction = new OpenAction(getSite());
openAction
.setActionDefinitionId(IJavaEditorActionDefinitionIds.OPEN_EDITOR);
ab.setGlobalActionHandler(JdtActionConstants.OPEN, openAction);
openAction.setEnabled(false);
viewer.addSelectionChangedListener(openAction);
PropertyDialogAction propertiesAction = new PropertyDialogAction(getSite(),
viewer);
propertiesAction
.setActionDefinitionId(IWorkbenchCommandConstants.FILE_PROPERTIES);
ab.setGlobalActionHandler(ActionFactory.PROPERTIES.getId(),
propertiesAction);
propertiesAction.setEnabled(false);
viewer.addSelectionChangedListener(propertiesAction);
}
开发者ID:eclipse,项目名称:eclemma,代码行数:22,代码来源:CoverageView.java
示例2: run
import org.eclipse.jdt.ui.actions.OpenAction; //导入依赖的package包/类
@Override
public void run() {
IJavaElement inputElement= fInfoView.getOrignalInput();
new OpenAction(fInfoView.getViewSite()).run(new Object[] { inputElement });
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:6,代码来源:GotoInputAction.java
示例3: createActions
import org.eclipse.jdt.ui.actions.OpenAction; //导入依赖的package包/类
@Override
protected void createActions() {
super.createActions();
fSelectAllAction= new SelectAllAction(fViewer);
// Setup OpenAction
fOpen= new OpenAction(getViewSite()) {
/*
* @see org.eclipse.jdt.ui.actions.SelectionDispatchAction#getSelection()
*/
@Override
public ISelection getSelection() {
return convertToJavaElementSelection(fViewer.getSelection());
}
/*
* @see org.eclipse.jdt.ui.actions.OpenAction#run(IStructuredSelection)
*/
@Override
public void run(IStructuredSelection selection) {
if (selection.isEmpty()) {
getShell().getDisplay().beep();
return;
}
super.run(selection);
}
/*
* @see org.eclipse.jdt.ui.actions.OpenAction#getElementToOpen(Object)
*/
@Override
public Object getElementToOpen(Object object) throws JavaModelException {
if (object instanceof IJavaElement)
fLastOpenedElement= (IJavaElement)object;
else
fLastOpenedElement= null;
return super.getElementToOpen(object);
}
/*
* @see org.eclipse.jdt.ui.actions.OpenAction#run(Object[])
*/
@Override
public void run(Object[] elements) {
stopListeningForSelectionChanges();
super.run(elements);
startListeningForSelectionChanges();
}
};
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:52,代码来源:SourceView.java
示例4: OpenAndExpand
import org.eclipse.jdt.ui.actions.OpenAction; //导入依赖的package包/类
public OpenAndExpand(IWorkbenchSite site, OpenAction openAction, TreeViewer viewer) {
super(site);
fOpenAction = openAction;
fViewer = viewer;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:6,代码来源:OpenAndExpand.java
示例5: run
import org.eclipse.jdt.ui.actions.OpenAction; //导入依赖的package包/类
@Override
public void run() {
IJavaElement inputElement= fInfoView.getInput();
new OpenAction(fInfoView.getViewSite()).run(new Object[] { inputElement });
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:6,代码来源:GotoInputAction.java
注:本文中的org.eclipse.jdt.ui.actions.OpenAction类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论