當前位置: 首頁>>代碼示例>>Java>>正文


Java IPersistableElement類代碼示例

本文整理匯總了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);
}
 
開發者ID:iloveeclipse,項目名稱:skin4eclipse,代碼行數:22,代碼來源:EditorInfo.java

示例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;
			}
		};
	}
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:26,代碼來源:OpenAPICloudWizardActionDelegate.java

示例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());
        }
    };
}
 
開發者ID:nextinterfaces,項目名稱:http4e,代碼行數:13,代碼來源:HdJavaEditorInput.java

示例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;
}
 
開發者ID:Yakindu,項目名稱:statecharts,代碼行數:8,代碼來源:DiagramEditorInput.java

示例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;
}
 
開發者ID:google,項目名稱:depan,代碼行數:12,代碼來源:NavigatorRoot.java

示例6: getFactoryId

import org.eclipse.ui.IPersistableElement; //導入依賴的package包/類
@Override
public String getFactoryId()
{
    if (input instanceof IPersistableElement)
        return ((IPersistableElement)input).getFactoryId();
    return null;
}
 
開發者ID:kasemir,項目名稱:org.csstudio.display.builder,代碼行數:8,代碼來源:DataBrowserModelEditorInput.java

示例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;
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:32,代碼來源:CheckLoaderDialog.java

示例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;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:30,代碼來源:JavaElementAdapterFactory.java

示例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;
	}
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:16,代碼來源:JarEntryEditorInput.java

示例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);
    }

}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:11,代碼來源:Mementos.java

示例11: getPersistable

import org.eclipse.ui.IPersistableElement; //導入依賴的package包/類
@Override
public IPersistableElement getPersistable() {
    return null;
}
 
開發者ID:baloise,項目名稱:eZooKeeper,代碼行數:5,代碼來源:BaseEditorInput.java

示例12: getPersistable

import org.eclipse.ui.IPersistableElement; //導入依賴的package包/類
@Override
public IPersistableElement getPersistable ()
{
    return null;
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:6,代碼來源:FactoryEditorInput.java

示例13: getPersistable

import org.eclipse.ui.IPersistableElement; //導入依賴的package包/類
public IPersistableElement getPersistable() {
	return null;
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:4,代碼來源:ConnectorEditorInput.java

示例14: getPersistable

import org.eclipse.ui.IPersistableElement; //導入依賴的package包/類
@Override
public IPersistableElement getPersistable() {
	return null;
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:5,代碼來源:ApplicationComponentEditorInput.java

示例15: getPersistable

import org.eclipse.ui.IPersistableElement; //導入依賴的package包/類
@Override
public IPersistableElement getPersistable() {
    return this;
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:5,代碼來源:ProjectEditorInput.java


注:本文中的org.eclipse.ui.IPersistableElement類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。