本文整理汇总了Java中org.eclipse.ui.views.properties.PropertyDescriptor.setLabelProvider方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyDescriptor.setLabelProvider方法的具体用法?Java PropertyDescriptor.setLabelProvider怎么用?Java PropertyDescriptor.setLabelProvider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ui.views.properties.PropertyDescriptor
的用法示例。
在下文中一共展示了PropertyDescriptor.setLabelProvider方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPropertyDescriptors
import org.eclipse.ui.views.properties.PropertyDescriptor; //导入方法依赖的package包/类
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
List<IPropertyDescriptor> list = new ArrayList<>();
PropertyDescriptor name = new PropertyDescriptor("Name", "Name");
name.setCategory("General");
PropertyDescriptor version = new PropertyDescriptor("Version", "Version");
version.setCategory("General");
PropertyDescriptor exporter = new PropertyDescriptor("Export", "Exported By");
exporter.setCategory("General");
PropertyDescriptor reexporter = new PropertyDescriptor("Reexport",
"Reexported By");
reexporter.setCategory("General");
PropertyDescriptor log = new PropertyDescriptor("Log", "Log");
log.setCategory("General");
log.setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
if (element instanceof List<?>) {
List<?> logList = (List<?>) element;
StringBuilder out = new StringBuilder();
for (Object logEntry : logList) {
out.append(logEntry + "\n");
}
return out.toString();
}
return "";
}
});
PropertyDescriptor importedBy = new PropertyDescriptor("Import", "Imported By");
Collections.addAll(list, name, version, exporter, importedBy, reexporter, log);
return list.toArray(new IPropertyDescriptor[list.size()]);
}
示例2: createPropertyDescriptor
import org.eclipse.ui.views.properties.PropertyDescriptor; //导入方法依赖的package包/类
@Override
protected IPropertyDescriptor createPropertyDescriptor(String name)
{
if(name.equals(InstallOptionsModel.PROPERTY_FILTER)) {
String propertyName = InstallOptionsPlugin.getResourceString("filter.property.name"); //$NON-NLS-1$
PropertyDescriptor descriptor = new PropertyDescriptor(InstallOptionsModel.PROPERTY_FILTER, propertyName){
@Override
public CellEditor createPropertyEditor(Composite parent)
{
final FileFilterCellEditor editor = new FileFilterCellEditor(InstallOptionsFileRequest.this, parent);
editor.setValidator(getValidator());
final PropertyChangeListener listener = new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt)
{
if(evt.getPropertyName().equals(getId())) {
editor.setValue(evt.getNewValue());
}
}
};
InstallOptionsFileRequest.this.addPropertyChangeListener(listener);
editor.getControl().addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e)
{
InstallOptionsFileRequest.this.removePropertyChangeListener(listener);
}
});
return editor;
}
};
descriptor.setLabelProvider(FILTER_LABEL_PROVIDER);
descriptor.setValidator(new NSISStringLengthValidator(propertyName));
return descriptor;
}
else {
return super.createPropertyDescriptor(name);
}
}
示例3: workloadDescriptor
import org.eclipse.ui.views.properties.PropertyDescriptor; //导入方法依赖的package包/类
/**
* @param descriptors
* @param propertyid
*/
private void workloadDescriptor(Collection descriptors, PropertyID propertyid) {
PropertyDescriptor pd = new PropertyDescriptor(propertyid, Messages.getString("URNElementPropertySource.workload")); //$NON-NLS-1$
pd.setCategory(Messages.getString("URNElementPropertySource.performance")); //$NON-NLS-1$
pd.setLabelProvider(new LabelProvider() {
public String getText(Object element) {
return ""; //$NON-NLS-1$
}
});
descriptors.add(pd);
}
示例4: getPropertyDescriptors
import org.eclipse.ui.views.properties.PropertyDescriptor; //导入方法依赖的package包/类
@Override
public IPropertyDescriptor[] getPropertyDescriptors()
{
PropertyDescriptor desc = new PropertyDescriptor("line.node", "Node");
desc.setLabelProvider(new NodeLabelProvider());
return new IPropertyDescriptor[] {desc};
}
示例5: getPropertyDescriptors
import org.eclipse.ui.views.properties.PropertyDescriptor; //导入方法依赖的package包/类
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
PropertyDescriptor propertyDescriptor = new PropertyDescriptor(propertyName, "Updated value");
propertyDescriptor.setLabelProvider(new PropertyLabelProvider(true, PropertyIcon.NONE));
return new IPropertyDescriptor[] { propertyDescriptor };
}
示例6: getPropertyDescriptors
import org.eclipse.ui.views.properties.PropertyDescriptor; //导入方法依赖的package包/类
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
List<IPropertyDescriptor> list = new ArrayList<>();
PropertyDescriptor name = new PropertyDescriptor("Id", "Id");
name.setCategory("General");
PropertyDescriptor version = new PropertyDescriptor("Version", "Version");
version.setCategory("General");
PropertyDescriptor path = new PropertyDescriptor("Path", "Path");
path.setCategory("General");
PropertyDescriptor log = new PropertyDescriptor("Log", "Log");
log.setCategory("General");
log.setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
if (element instanceof List<?>) {
List<?> logList = (List<?>) element;
StringBuilder out = new StringBuilder();
for (Object logEntry : logList) {
out.append(logEntry + "\n");
}
return out.toString();
}
return "";
}
});
PropertyDescriptor incPlugins = new PropertyDescriptor("IncludedPlugins",
"Included Plugins");
incPlugins.setCategory("Requirements");
PropertyDescriptor incFeatures = new PropertyDescriptor("IncludedFeatures",
"Included Features");
incFeatures.setCategory("Requirements");
PropertyDescriptor reqPlugins = new PropertyDescriptor("RequiredPlugins",
"Required Plugins");
reqPlugins.setCategory("Requirements");
PropertyDescriptor reqFeatures = new PropertyDescriptor("RequiredFeatures",
"Required Features");
reqFeatures.setCategory("Requirements");
PropertyDescriptor resReqPlugins = new PropertyDescriptor("ResolvedRequiredPlugins", "Required Plugins (resolved)");
resReqPlugins.setCategory("Resolution");
PropertyDescriptor resReqFeatures = new PropertyDescriptor("ResolvedRequiredFeatures", "Required Features (resolved)");
resReqFeatures.setCategory("Resolution");
PropertyDescriptor resIncPlugins = new PropertyDescriptor("ResolvedIncludedPlugins", "Included Plugins (resolved)");
resIncPlugins.setCategory("Resolution");
PropertyDescriptor resIncFeatures = new PropertyDescriptor("ResolvedIncludedFeatures", "Included Features (resolved)");
resIncFeatures.setCategory("Resolution");
PropertyDescriptor includedIn = new PropertyDescriptor("IncludedIn",
"Included In");
Collections.addAll(list, name, version, path, log, incPlugins, incFeatures,
reqPlugins, reqFeatures, resReqPlugins, resReqFeatures, resIncPlugins, resIncFeatures,
includedIn);
return list.toArray(new IPropertyDescriptor[list.size()]);
}
示例7: getPropertyDescriptors
import org.eclipse.ui.views.properties.PropertyDescriptor; //导入方法依赖的package包/类
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
List<IPropertyDescriptor> list = new ArrayList<>();
PropertyDescriptor name = new PropertyDescriptor("SymbolicName", "SymbolicName");
name.setCategory("General");
PropertyDescriptor version = new PropertyDescriptor("Version", "Version");
version.setCategory("General");
PropertyDescriptor path = new PropertyDescriptor("Path", "Path");
path.setCategory("General");
PropertyDescriptor log = new PropertyDescriptor("Log", "Log");
log.setCategory("General");
log.setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
if (element instanceof List<?>) {
List<?> logList = (List<?>) element;
StringBuilder out = new StringBuilder();
for (Object logEntry : logList) {
out.append(logEntry + "\n");
}
return out.toString();
}
return "";
}
});
PropertyDescriptor reqPlugins = new PropertyDescriptor("RequiredPlugins", "Required Plugins");
reqPlugins.setCategory("Requirements");
PropertyDescriptor reqPackages = new PropertyDescriptor("ImportedPackages", "Imported Packages");
reqPackages.setCategory("Requirements");
PropertyDescriptor resPlugins = new PropertyDescriptor("ResolvedRequiredPlugins", "Required Plugins (resolved)");
resPlugins.setCategory("Resolution");
PropertyDescriptor resPackages = new PropertyDescriptor("ResolvedImportedPackages", "Imported Packages (resolved)");
resPackages.setCategory("Resolution");
PropertyDescriptor allDeps = new PropertyDescriptor("AllDependencies", "All Dependencies (resolved)");
allDeps.setCategory("Resolution");
PropertyDescriptor expPackages = new PropertyDescriptor("ExportedPackages", "Exported Packages");
PropertyDescriptor requiredBy = new PropertyDescriptor("RequiredBy", "Required By");
PropertyDescriptor includedIn = new PropertyDescriptor("IncludedIn", "Included In");
Collections.addAll(list, name, version, path, log, reqPlugins, reqPackages,
resPackages, resPlugins, expPackages, requiredBy, includedIn, allDeps);
return list.toArray(new IPropertyDescriptor[list.size()]);
}
示例8: createPropertyDescriptor
import org.eclipse.ui.views.properties.PropertyDescriptor; //导入方法依赖的package包/类
@Override
protected IPropertyDescriptor createPropertyDescriptor(String name)
{
if(name.equals(InstallOptionsModel.PROPERTY_TYPE)) {
return new PropertyDescriptor(InstallOptionsModel.PROPERTY_TYPE, InstallOptionsPlugin.getResourceString("type.property.name")) { //$NON-NLS-1$
@Override
public CellEditor createPropertyEditor(Composite parent)
{
Collection<InstallOptionsModelTypeDef> coll = InstallOptionsModel.INSTANCE.getControlTypeDefs();
List<String> types = new ArrayList<String>();
for (Iterator<InstallOptionsModelTypeDef> iter = coll.iterator(); iter.hasNext();) {
InstallOptionsModelTypeDef typeDef = iter.next();
types.add(typeDef.getType());
}
return new CustomComboBoxCellEditor(parent,types);
}
};
}
else if(name.equals(InstallOptionsModel.PROPERTY_INDEX)) {
return new IndexPropertyDescriptor();
}
else if(name.equals(InstallOptionsModel.PROPERTY_POSITION)) {
PropertyDescriptor positionPropertyDescriptor = new PropertyDescriptor(InstallOptionsModel.PROPERTY_POSITION, InstallOptionsPlugin.getResourceString("position.property.name")); //$NON-NLS-1$
positionPropertyDescriptor.setLabelProvider(cPositionLabelProvider);
return positionPropertyDescriptor;
}
else if(name.equals(InstallOptionsModel.PROPERTY_FLAGS)) {
return new FlagsPropertyDescriptor();
}
else if(name.equals(PROPERTY_LOCKED)) {
String propertyName = InstallOptionsPlugin.getResourceString("locked.property.name"); //$NON-NLS-1$
CustomComboBoxPropertyDescriptor descriptor = new CustomComboBoxPropertyDescriptor(PROPERTY_LOCKED,
propertyName, new Object[] {Boolean.TRUE,Boolean.FALSE},
new String[] {cLockedLabelProvider.getText(Boolean.TRUE),
cLockedLabelProvider.getText(Boolean.FALSE)}, 1);
descriptor.setValidator(new NSISStringLengthValidator(propertyName));
descriptor.setLabelProvider(cLockedLabelProvider);
return descriptor;
}
else {
return null;
}
}