本文整理匯總了Java中org.eclipse.ui.IPersistableElement類的典型用法代碼示例。如果您正苦於以下問題:Java IPersistableElement類的具體用法?Java IPersistableElement怎麽用?Java IPersistableElement使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
IPersistableElement類屬於org.eclipse.ui包,在下文中一共展示了IPersistableElement類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: saveState
import org.eclipse.ui.IPersistableElement; //導入依賴的package包/類
/**
* Saves the object state in the given memento.
*
* @param memento the memento to save the object state in
*/
public void saveState(IMemento memento) {
if (!isConsistent() || input == null) {
return;
}
IPersistableElement persistable = input.getPersistable();
memento.putString("factoryID", persistable.getFactoryId());
memento.putString("id", editorId);
memento.putInteger("number", number);
/*
* Store IPersistable of the IEditorInput in a separate section
* since it could potentially use a tag already used in the parent
* memento and thus overwrite data.
*/
IMemento persistableMemento = memento.createChild("persistable");
persistable.saveState(persistableMemento);
}
示例2: getInput
import org.eclipse.ui.IPersistableElement; //導入依賴的package包/類
public static void getInput() {
if(input == null) {
input = new IEditorInput() {
@SuppressWarnings("rawtypes")
public Object getAdapter(Class adapter) {
return null;
}
public String getToolTipText() {
return "test";
}
public IPersistableElement getPersistable() {
return null;
}
public String getName() {
return "uz";
}
public ImageDescriptor getImageDescriptor() {
return null;
}
public boolean exists() {
return true;
}
};
}
}
示例3: getPersistable
import org.eclipse.ui.IPersistableElement; //導入依賴的package包/類
public IPersistableElement getPersistable() {
return new IPersistableElement() {
public String getFactoryId() {
return FACTORY_ID;
}
public void saveState(IMemento memento) {
memento.putString(FEATURE_ID, aboutInfo.getFeatureId() + ':'
+ aboutInfo.getVersionId());
}
};
}
示例4: getPersistable
import org.eclipse.ui.IPersistableElement; //導入依賴的package包/類
@Override
public IPersistableElement getPersistable() {
// TODO: It is currently not possible to restore Editors with open
// DiagramEditorInput cause they will not act on the shared editing
// domain
return null;
}
示例5: getAdapter
import org.eclipse.ui.IPersistableElement; //導入依賴的package包/類
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public Object getAdapter(Class adapter) {
if (adapter == IPersistableElement.class) {
return this;
}
if (adapter == IWorkbenchAdapter.class) {
return ResourcesPlugin.getWorkspace().getRoot().getAdapter(adapter);
}
return null;
}
示例6: getFactoryId
import org.eclipse.ui.IPersistableElement; //導入依賴的package包/類
@Override
public String getFactoryId()
{
if (input instanceof IPersistableElement)
return ((IPersistableElement)input).getFactoryId();
return null;
}
示例7: getInput
import org.eclipse.ui.IPersistableElement; //導入依賴的package包/類
public IEditorInput getInput() {
if (input == null) {
input = new IEditorInput() {
public Object getAdapter(
@SuppressWarnings("rawtypes") Class adapter) {
return null;
}
public String getToolTipText() {
return "custom app loader";
}
public IPersistableElement getPersistable() {
return null;
}
public String getName() {
return "apploader";
}
public ImageDescriptor getImageDescriptor() {
return null;
}
public boolean exists() {
return true;
}
};
}
return input;
}
示例8: getAdapter
import org.eclipse.ui.IPersistableElement; //導入依賴的package包/類
public Object getAdapter(Object element, Class key) {
updateLazyLoadedAdapters();
IJavaElement java= getJavaElement(element);
if (IPropertySource.class.equals(key)) {
return getProperties(java);
} if (IResource.class.equals(key)) {
return getResource(java);
} if (fSearchPageScoreComputer != null && ISearchPageScoreComputer.class.equals(key)) {
return fSearchPageScoreComputer;
} if (IWorkbenchAdapter.class.equals(key)) {
return getJavaWorkbenchAdapter();
} if (IResourceLocator.class.equals(key)) {
return getResourceLocator();
} if (IPersistableElement.class.equals(key)) {
return new PersistableJavaElementFactory(java);
} if (IContributorResourceAdapter.class.equals(key)) {
return this;
} if (IContributorResourceAdapter2.class.equals(key)) {
return this;
} if (ITaskListResourceAdapter.class.equals(key)) {
return getTaskListAdapter();
} if (IContainmentAdapter.class.equals(key)) {
return getJavaElementContainmentAdapter();
} if (fIsTeamUILoaded && IHistoryPageSource.class.equals(key) && JavaElementHistoryPageSource.hasEdition(java)) {
return JavaElementHistoryPageSource.getInstance();
}
return null;
}
示例9: getPersistable
import org.eclipse.ui.IPersistableElement; //導入依賴的package包/類
public IPersistableElement getPersistable() {
if (fJarEntryFile instanceof IJarEntryResource) {
return new IPersistableElement() {
public void saveState(IMemento memento) {
JarEntryEditorInputFactory.saveState(memento, (IJarEntryResource) fJarEntryFile);
}
public String getFactoryId() {
return JarEntryEditorInputFactory.FACTORY_ID;
}
};
} else {
return null;
}
}
示例10: saveItem
import org.eclipse.ui.IPersistableElement; //導入依賴的package包/類
public static void saveItem(IMemento memento, IAdaptable element) {
IPersistableElement persistable= (IPersistableElement)element.getAdapter(IPersistableElement.class);
if (persistable != null) {
memento.putString(
TAG_FACTORY_ID,
persistable.getFactoryId());
persistable.saveState(memento);
}
}
示例11: getPersistable
import org.eclipse.ui.IPersistableElement; //導入依賴的package包/類
@Override
public IPersistableElement getPersistable() {
return null;
}
示例12: getPersistable
import org.eclipse.ui.IPersistableElement; //導入依賴的package包/類
@Override
public IPersistableElement getPersistable ()
{
return null;
}
示例13: getPersistable
import org.eclipse.ui.IPersistableElement; //導入依賴的package包/類
public IPersistableElement getPersistable() {
return null;
}
示例14: getPersistable
import org.eclipse.ui.IPersistableElement; //導入依賴的package包/類
@Override
public IPersistableElement getPersistable() {
return null;
}
示例15: getPersistable
import org.eclipse.ui.IPersistableElement; //導入依賴的package包/類
@Override
public IPersistableElement getPersistable() {
return this;
}