下面列出了怎么用org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* Indicates that the given contributor no longer needs a registry. The
* registry will be disposed when no other contributor of the same type
* needs it.
*
* @param target
* the contributor;
*/
public void disposeRegistry(ITabbedPropertySheetPageContributor target) {
/**
* Get the contributor id from the ITabbedPropertySheetPageContributor
* interface
*/
String key = target.getContributorId();
CacheData data = idToCacheData.get(key);
if (data != null) {
data.references.remove(target);
if (data.references.isEmpty()) {
data.registry.dispose();
idToCacheData.remove(key);
}
}
}
public Object getAdapter(Object adaptableObject, Class adapterType) {
if (adaptableObject instanceof crossflow.diagram.navigator.CrossflowAbstractNavigatorItem
&& adapterType == ITabbedPropertySheetPageContributor.class) {
return propertySheetPageContributor;
}
return null;
}
/**
* Creates a registry for the given contributor.
*
* @param target
* the contributor.
* @return a registry for the given contributor.
*/
public TabbedPropertyRegistry createRegistry(
ITabbedPropertySheetPageContributor target) {
/**
* Get the contributor id from the ITabbedPropertySheetPageContributor
* interface
*/
String key = target.getContributorId();
CacheData data = idToCacheData.get(key);
if (data == null) {
data = new CacheData();
/*
* use here custom TabbedPropertyRegistry
* that are aware of viewID in which they are used
*/
if (key.equals("org.bonitasoft.studio.diagram") //$NON-NLS-1$
|| key.equals("org.bonitasoft.studio.diagram.form")) { //$NON-NLS-1$
data.registry = new TabbedPropertyRegistryViewAware(key);
} else {
data.registry = new TabbedPropertyRegistry(key);
}
data.references = new ArrayList<>(5);
idToCacheData.put(key, data);
}
data.references.add(target);
// keeps track of contributor using the same registry
return data.registry;
}
public Object getAdapter(Object adaptableObject, Class adapterType) {
if (adaptableObject instanceof org.bonitasoft.studio.model.process.diagram.navigator.ProcessAbstractNavigatorItem
&& adapterType == ITabbedPropertySheetPageContributor.class) {
return propertySheetPageContributor;
}
return null;
}
public BonitaApplicationPropertiesBrowserPage(
ITabbedPropertySheetPageContributor contributor) {
super(contributor);
}
public BonitaExecutionPropertiesBrowserPage(
ITabbedPropertySheetPageContributor contributor) {
super(contributor);
}
public BonitaGeneralProcessPropertiesBrowserPage(
ITabbedPropertySheetPageContributor contributor) {
super(contributor);
}
public BonitaAppearancePropertiesBrowserPage(
ITabbedPropertySheetPageContributor contributor) {
super(contributor);
}
public BonitaDataPropertiesBrowserPage(
final ITabbedPropertySheetPageContributor contributor) {
super(contributor);
}
public BonitaPropertiesBrowserPage(
final ITabbedPropertySheetPageContributor contributor) {
super(contributor);
}
protected abstract BonitaPropertiesBrowserPage getBonitaPropertiesBrowserPage(
ITabbedPropertySheetPageContributor part);
@Override
protected BonitaPropertiesBrowserPage getBonitaPropertiesBrowserPage(
ITabbedPropertySheetPageContributor part) {
return new BonitaGeneralProcessPropertiesBrowserPage(part);
}
@Override
protected BonitaPropertiesBrowserPage getBonitaPropertiesBrowserPage(
ITabbedPropertySheetPageContributor part) {
return new BonitaAppearancePropertiesBrowserPage(part);
}
@Override
protected BonitaPropertiesBrowserPage getBonitaPropertiesBrowserPage(
ITabbedPropertySheetPageContributor part) {
return new BonitaExecutionPropertiesBrowserPage(part);
}
@Override
protected BonitaPropertiesBrowserPage getBonitaPropertiesBrowserPage(
final ITabbedPropertySheetPageContributor part) {
return new BonitaDataPropertiesBrowserPage(part);
}