|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.csstudio.ui.util.NoResourceEditorInput
public class NoResourceEditorInput
Terrible Hack to avoid extra context menu entries
Eclipse Editors are often associated with a file,
specifically IFile
which is an IResource
.
Depending on what else is included in the overall
product, the context menu of such editors will then receive
certain menu entries that don't make sense to the end user:
When inspecting for example org.eclipse.debug.ui/plugin.xml of Eclipse 3.7.2, it turned out to contribute the "Run As" context menu for any editor input that adapts to IResource.
To avoid such context menu entries, we wrap the actual
editor input into something that does not adapt
to a plain IResource
, but otherwise forwards
to the original IEditorInput
.
When the editor wraps its input (received in init()
and maybe set in saveAs()
the nonapplicable context menu entries can be avoided
- at least with Eclipse 3.7.2 for team, debug.ui and PyDev;
it is a hack after all.
Constructor Summary | |
---|---|
NoResourceEditorInput(IEditorInput orig)
Initialize |
Method Summary | |
---|---|
boolean |
exists()
|
java.lang.Object |
getAdapter(java.lang.Class adapter)
Do NOT adapt to IResource |
ImageDescriptor |
getImageDescriptor()
|
java.lang.String |
getName()
|
IEditorInput |
getOriginEditorInput()
|
IPersistableElement |
getPersistable()
|
java.lang.String |
getToolTipText()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NoResourceEditorInput(IEditorInput orig)
orig
- Original editor inputMethod Detail |
---|
public IEditorInput getOriginEditorInput()
public java.lang.Object getAdapter(java.lang.Class adapter)
public boolean exists()
public ImageDescriptor getImageDescriptor()
public java.lang.String getName()
public IPersistableElement getPersistable()
public java.lang.String getToolTipText()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |