org.eclipse.ui.IPersistableElement Java Examples

The following examples show how to use org.eclipse.ui.IPersistableElement. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JarEntryEditorInput.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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;
	}
}
 
Example #2
Source File: Mementos.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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);
    }

}
 
Example #3
Source File: JavaElementAdapterFactory.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
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;
}
 
Example #4
Source File: HdJavaEditorInput.java    From http4e with Apache License 2.0 5 votes vote down vote up
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());
        }
    };
}
 
Example #5
Source File: DiagramEditorInput.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
@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;
}
 
Example #6
Source File: NavigatorRoot.java    From depan with Apache License 2.0 5 votes vote down vote up
@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;
}
 
Example #7
Source File: DFSActionImpl.java    From RDFS with Apache License 2.0 4 votes vote down vote up
public IPersistableElement getPersistable() {
  return null;
}
 
Example #8
Source File: OpenDashboardHandler.java    From developer-studio with Apache License 2.0 4 votes vote down vote up
public IPersistableElement getPersistable() {
	return null;
}
 
Example #9
Source File: WorkspaceFileEditorInput.java    From textuml with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public IPersistableElement getPersistable() {
    return parent.getPersistable();
}
 
Example #10
Source File: TextUMLViewer.java    From textuml with Eclipse Public License 1.0 4 votes vote down vote up
public IPersistableElement getPersistable() {
    return wrappedEditorInput.getPersistable();
}
 
Example #11
Source File: TaskEditorInput.java    From codeexamples-eclipse with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public IPersistableElement getPersistable() {
	return null;
}
 
Example #12
Source File: JSEditorInput.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
public IPersistableElement getPersistable( )
{
	// TODO Auto-generated method stub
	return null;
}
 
Example #13
Source File: ReportEditorInput.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
public IPersistableElement getPersistable( )
{
	return this;
}
 
Example #14
Source File: DebugJsInput.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
public IPersistableElement getPersistable( )
{
	return this;
}
 
Example #15
Source File: MaterialsDatabaseEditorInput.java    From ice with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public IPersistableElement getPersistable() {
	// TODO Auto-generated method stub
	return null;
}
 
Example #16
Source File: GridEditorInput.java    From ice with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public IPersistableElement getPersistable() {
	return null;
}
 
Example #17
Source File: ICEFormInput.java    From ice with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public IPersistableElement getPersistable() {
	// TODO Auto-generated method stub
	return null;
}
 
Example #18
Source File: DFSActionImpl.java    From hadoop-gpu with Apache License 2.0 4 votes vote down vote up
public IPersistableElement getPersistable() {
  return null;
}
 
Example #19
Source File: PydevZipFileEditorInput.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public IPersistableElement getPersistable() {
    return this;
}
 
Example #20
Source File: PydevFileEditorInput.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public IPersistableElement getPersistable() {
    return this;
}
 
Example #21
Source File: PydevFileEditorInputStub.java    From Pydev with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public IPersistableElement getPersistable() {
    throw new RuntimeException("Not implemented");
}
 
Example #22
Source File: ScriptEditorInput.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
@Override
public IPersistableElement getPersistable() {
    return null;
}
 
Example #23
Source File: ModelEditorInput.java    From olca-app with Mozilla Public License 2.0 4 votes vote down vote up
@Override
public IPersistableElement getPersistable() {
	return null;
}
 
Example #24
Source File: SimpleEditorInput.java    From olca-app with Mozilla Public License 2.0 4 votes vote down vote up
@Override
public IPersistableElement getPersistable() {
	return null;
}
 
Example #25
Source File: GraphicalEditorInput.java    From olca-app with Mozilla Public License 2.0 4 votes vote down vote up
@Override
public IPersistableElement getPersistable() {
	return null;
}
 
Example #26
Source File: SimulationEditor.java    From olca-app with Mozilla Public License 2.0 4 votes vote down vote up
@Override
public IPersistableElement getPersistable() {
	return null;
}
 
Example #27
Source File: ResultEditorInput.java    From olca-app with Mozilla Public License 2.0 4 votes vote down vote up
@Override
public IPersistableElement getPersistable() {
	return null;
}
 
Example #28
Source File: WelcomePageEditorInput.java    From codewind-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public IPersistableElement getPersistable() {
	return this;
}
 
Example #29
Source File: NodeListEditorInput.java    From depan with Apache License 2.0 4 votes vote down vote up
@Override
public IPersistableElement getPersistable() {
  return null;
}
 
Example #30
Source File: ApplicationOverviewEditorInput.java    From codewind-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public IPersistableElement getPersistable() {
	return this;
}