当前位置: 首页>>代码示例>>Java>>正文


Java PropertyDescriptor.setLabelProvider方法代码示例

本文整理汇总了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()]);
}
 
开发者ID:iloveeclipse,项目名称:plugindependencies,代码行数:37,代码来源:PackageAdapter.java

示例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);
    }
}
 
开发者ID:henrikor2,项目名称:eclipsensis,代码行数:38,代码来源:InstallOptionsFileRequest.java

示例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);
}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:16,代码来源:URNElementPropertySource.java

示例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};
}
 
开发者ID:TheWhiteShadow3,项目名称:cuina,代码行数:8,代码来源:RubyNodeConverter.java

示例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 };
}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:7,代码来源:ObsoletePropertyPropertySource.java

示例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()]);
}
 
开发者ID:iloveeclipse,项目名称:plugindependencies,代码行数:59,代码来源:FeatureAdapter.java

示例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()]);
}
 
开发者ID:iloveeclipse,项目名称:plugindependencies,代码行数:58,代码来源:PluginAdapter.java

示例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;
    }
}
 
开发者ID:henrikor2,项目名称:eclipsensis,代码行数:44,代码来源:InstallOptionsWidget.java


注:本文中的org.eclipse.ui.views.properties.PropertyDescriptor.setLabelProvider方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。