org.eclipse.ui.views.properties.IPropertyDescriptor Java Examples

The following examples show how to use org.eclipse.ui.views.properties.IPropertyDescriptor. 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: BaseElementPropertySource.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public IPropertyDescriptor[] getPropertyDescriptors()
{
	List<IPropertyDescriptor> result = new ArrayList<IPropertyDescriptor>();

	for (P p : getPropertyInfoSet())
	{
		PropertyDescriptor descriptor = new PropertyDescriptor(p, p.getHeader());
		String category = p.getCategory();

		if (!StringUtil.isEmpty(category))
		{
			descriptor.setCategory(category);
		}

		result.add(descriptor);
	}

	return result.toArray(new IPropertyDescriptor[result.size()]);
}
 
Example #2
Source File: TraceEventPropertySource.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
    List<IPropertyDescriptor> list = new ArrayList<> ();
    list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_NAME_PROPERTY_ID, TRACE_EVENT_NAME_PROPERTY_NAME));
    list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_TYPE_PROPERTY_ID, TRACE_EVENT_TYPE_PROPERTY_NAME));
    list.add( new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_STATE_PROPERTY_ID, TRACE_EVENT_STATE_PROPERTY_NAME));
    if (fEvent.getLogLevel() != TraceLogLevel.LEVEL_UNKNOWN) {
        list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_LOGLEVEL_PROPERTY_ID, TRACE_EVENT_LOGLEVEL_PROPERTY_NAME));
    }
    if (fEvent.getFilterExpression() != null) {
        list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_FILTER_PROPERTY_ID, TRACE_EVENT_FILTER_PROPERTY_NAME));
    }
    if (fEvent.getExcludedEvents() != null && !fEvent.getExcludedEvents().isEmpty()) {
        list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_EXCLUDE_PROPERTY_ID, TRACE_EVENT_EXCLUDE_PROPERTY_NAME));
    }
    return list.toArray(new IPropertyDescriptor[list.size()]);
}
 
Example #3
Source File: TmfTraceElement.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
    Map<String, String> traceProperties = getTraceProperties();
    if (!traceProperties.isEmpty()) {
        IPropertyDescriptor[] propertyDescriptorArray = new IPropertyDescriptor[traceProperties.size() + sfDescriptors.length];
        int index = 0;
        for (Map.Entry<String, String> varName : traceProperties.entrySet()) {
            ReadOnlyTextPropertyDescriptor descriptor = new ReadOnlyTextPropertyDescriptor(this.getName() + "_" + varName.getKey(), varName.getKey()); //$NON-NLS-1$
            descriptor.setCategory(TRACE_PROPERTIES_CATEGORY);
            propertyDescriptorArray[index] = descriptor;
            index++;
        }
        System.arraycopy(sfDescriptors, 0, propertyDescriptorArray, index, sfDescriptors.length);
        return propertyDescriptorArray;
    }
    return Arrays.copyOf(sfDescriptors, sfDescriptors.length);
}
 
Example #4
Source File: PropertyPageAdapterFactory.java    From spotbugs with GNU Lesser General Public License v2.1 6 votes vote down vote up
public MarkerPropertySource(IMarker marker) {
    this.marker = marker;
    List<IPropertyDescriptor> props = new ArrayList<>();
    try {
        Map<?, ?> attributes = marker.getAttributes();
        Set<?> keySet = new TreeSet<Object>(attributes.keySet());
        for (Object object : keySet) {
            props.add(new PropertyDescriptor(object, "" + object));
        }
    } catch (CoreException e) {
        FindbugsPlugin.getDefault().logException(e, "MarkerPropertySource: marker access failed");
    }
    props.add(new PropertyDescriptor(PropId.Bug, "Bug"));
    props.add(new PropertyDescriptor(PropId.Resource, "Resource"));
    props.add(new PropertyDescriptor(PropId.Id, "Marker id"));
    props.add(new PropertyDescriptor(PropId.Type, "Marker type"));
    props.add(new PropertyDescriptor(PropId.CreationTime, "Creation time"));
    propertyDescriptors = props.toArray(new PropertyDescriptor[0]);
}
 
Example #5
Source File: TraceProbeEventPropertySource.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
    IPropertyDescriptor[] superProperties = super.getPropertyDescriptors();

    List<IPropertyDescriptor> superList = Arrays.asList(superProperties);
    ArrayList<IPropertyDescriptor> list = new ArrayList<>();
    list.addAll(superList);

    if (fEvent instanceof TraceProbeEventComponent) {
        TraceProbeEventComponent event = (TraceProbeEventComponent) fEvent;
        if (event.getAddress() != null) {
            list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_PROBE_ADDRESS_PROPERTY_ID, TRACE_EVENT_PROBE_ADDRESS_PROPERTY_NAME));
        }

        if (event.getOffset() != null) {
            list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_PROBE_OFFSET_PROPERTY_ID, TRACE_EVENT_PROBE_OFFSET_PROPERTY_NAME));
        }

        if (event.getSymbol() != null) {
            list.add(new ReadOnlyTextPropertyDescriptor(TRACE_EVENT_PROBE_SYMBOL_PROPERTY_ID, TRACE_EVENT_PROBE_SYMBOL_PROPERTY_NAME));
        }
    }
    return list.toArray(new IPropertyDescriptor[list.size()]);
}
 
Example #6
Source File: TraceChannelPropertySource.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
    List<IPropertyDescriptor> properties = new ArrayList<>();
    properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_NAME_PROPERTY_ID, TRACE_CHANNEL_NAME_PROPERTY_NAME));
    properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_STATE_PROPERTY_ID, TRACE_CHANNEL_STATE_PROPERTY_NAME));
    properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_OVERWRITE_MODE_PROPERTY_ID, TRACE_CHANNEL_OVERWRITE_MODE_PROPERTY_NAME));
    properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_SUBBUFFER_SIZE_PROPERTY_ID, TRACE_CHANNEL_SUBBUFFER_SIZE_PROPERTY_NAME));
    properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_NO_SUBBUFFERS_PROPERTY_ID, TRACE_CHANNEL_NO_SUBBUFFERS_PROPERTY_NAME));
    properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_SWITCH_TIMER_PROPERTY_ID, TRACE_CHANNEL_SWITCH_TIMER_PROPERTY_NAME));
    properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_READ_TIMER_PROPERTY_ID, TRACE_CHANNEL_READ_TIMER_PROPERTY_NAME));
    properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_OUTPUT_TYPE_PROPERTY_ID, TRACE_CHANNEL_OUTPUT_TYPEPROPERTY_NAME));

    if (fChannel.getTargetNode().isVersionSupported("2.5.0")) { //$NON-NLS-1$
        properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_TRACE_FILE_COUNT_PROPERTY_ID, TRACE_CHANNEL_TRACE_FILE_COUNT_PROPERTY_NAME));
        properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_TRACE_FILE_SIZE_PROPERTY_ID, TRACE_CHANNEL_TRACE_FILE_SIZE_PROPERTY_NAME));
    }
    if (fChannel.getTargetNode().isVersionSupported("2.8.0")) { //$NON-NLS-1$
        properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_DISCARDED_EVENTS_PROPERTY_ID, TRACE_CHANNEL_DISCARDED_EVENTS_PROPERTY_NAME));
        properties.add(new ReadOnlyTextPropertyDescriptor(TRACE_CHANNEL_LOST_PACKETS_PROPERTY_ID, TRACE_CHANNEL_LOST_PACKETS_PROPERTY_NAME));
    }
    return properties.toArray(new IPropertyDescriptor[0]);
}
 
Example #7
Source File: SVNRemoteResourcePropertySource.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Return the Property Descriptors for the receiver.
 */
public IPropertyDescriptor[] getPropertyDescriptors() {
	if (resource instanceof RemoteFile) {
		RemoteFile remoteFile = (RemoteFile)resource;
		if (remoteFile.getLock() != null) {
			IPropertyDescriptor[] descriptorsWithLocks = new IPropertyDescriptor[9];
			descriptorsWithLocks[0] = propertyDescriptors[0];
			descriptorsWithLocks[1] = propertyDescriptors[1];
			descriptorsWithLocks[2] = propertyDescriptors[2];
			descriptorsWithLocks[3] = propertyDescriptors[3];
			descriptorsWithLocks[4] = lockPropertyDescriptors[0];
			descriptorsWithLocks[5] = lockPropertyDescriptors[1];
			descriptorsWithLocks[6] = lockPropertyDescriptors[2];
			descriptorsWithLocks[7] = lockPropertyDescriptors[3];
			descriptorsWithLocks[8] = lockPropertyDescriptors[4];
			return descriptorsWithLocks;
		}
	}
	return propertyDescriptors;
}
 
Example #8
Source File: BaseElementPropertySource.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public IPropertyDescriptor[] getPropertyDescriptors()
{
	List<IPropertyDescriptor> result = new ArrayList<IPropertyDescriptor>();

	for (P p : getPropertyInfoSet())
	{
		PropertyDescriptor descriptor = new PropertyDescriptor(p, p.getHeader());
		String category = p.getCategory();

		if (!StringUtil.isEmpty(category))
		{
			descriptor.setCategory(category);
		}

		result.add(descriptor);
	}

	return result.toArray(new IPropertyDescriptor[result.size()]);
}
 
Example #9
Source File: BaseElement.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public IPropertyDescriptor[] getPropertyDescriptors()
{
	List<IPropertyDescriptor> result = new ArrayList<IPropertyDescriptor>();

	for (P p : getPropertyInfoSet())
	{
		PropertyDescriptor descriptor = new PropertyDescriptor(p, p.getHeader());
		String category = p.getCategory();

		if (!StringUtil.isEmpty(category))
		{
			descriptor.setCategory(category);
		}

		result.add(descriptor);
	}

	return result.toArray(new IPropertyDescriptor[result.size()]);
}
 
Example #10
Source File: TmfEventPropertySource.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
    List<IPropertyDescriptor> descriptors = new ArrayList<>(fContent.getFields().size());
    for (ITmfEventField field : fContent.getFields()) {
        if (field != null) {
            descriptors.add(new ReadOnlyTextPropertyDescriptor(field, field.getName()));
        }
    }
    return descriptors.toArray(new IPropertyDescriptor[0]);
}
 
Example #11
Source File: TmfEventPropertySource.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
    List<IPropertyDescriptor> descriptors= new ArrayList<>();

    /* Display basic event information */
    descriptors.add(new ReadOnlyTextPropertyDescriptor(ID_TIMESTAMP, NAME_TIMESTAMP));
    descriptors.add(new ReadOnlyTextPropertyDescriptor(ID_TYPE, NAME_TYPE));
    descriptors.add(new ReadOnlyTextPropertyDescriptor(ID_TRACE, NAME_TRACE));

    /* Display event fields */
    descriptors.add(new ReadOnlyTextPropertyDescriptor(ID_CONTENT, NAME_CONTENT));

    /* Display source lookup information, if the event supplies it */
    if ((fEvent instanceof ITmfSourceLookup) && (((ITmfSourceLookup)fEvent).getCallsite() != null)) {
        descriptors.add(new ReadOnlyTextPropertyDescriptor(ID_SOURCE_LOOKUP, NAME_SOURCE_LOOKUP));
    }

    /* Display Model URI information, if the event supplies it */
    if ((fEvent instanceof ITmfModelLookup) && (((ITmfModelLookup) fEvent).getModelUri() != null)) {
        descriptors.add(new ReadOnlyTextPropertyDescriptor(ID_MODEL_URI, NAME_MODEL_URI));
    }

    /* Display custom attributes, if available */
    if (fEvent instanceof ITmfCustomAttributes) {
        ITmfCustomAttributes event = (ITmfCustomAttributes) fEvent;
        if (!event.listCustomAttributes().isEmpty()) {
            descriptors.add(new ReadOnlyTextPropertyDescriptor(ID_CUSTOM_ATTRIBUTE, NAME_CUSTOM_ATTRIBUTES));
        }
    }

    return descriptors.toArray(new IPropertyDescriptor[0]);
}
 
Example #12
Source File: BtfEventPropertySource.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
    if (fEvent.getContent().getField(BtfColumnNames.NOTES.toString()) == null) {
        return DESCRIPTORS_WITHOUT_NOTES;
    }
    return DESCRIPTORS;
}
 
Example #13
Source File: TmfEventPropertySource.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
    List<IPropertyDescriptor> descriptors = new ArrayList<>();

    for (String customAttribute : event.listCustomAttributes()) {
        descriptors.add(new ReadOnlyTextPropertyDescriptor(customAttribute, customAttribute));
    }

    return descriptors.toArray(new IPropertyDescriptor[0]);
}
 
Example #14
Source File: SetPropertyValueOperation.java    From gef with Eclipse Public License 2.0 5 votes vote down vote up
private static IPropertyDescriptor getPropertyDescriptor(
		IPropertySource propertySource, Object propertyId) {
	for (IPropertyDescriptor propertyDescriptor : propertySource
			.getPropertyDescriptors()) {
		if (propertyDescriptor.getId().equals(propertyId)) {
			return propertyDescriptor;
		}
	}
	return null;
}
 
Example #15
Source File: BaseLoggerPropertySource.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
    List<IPropertyDescriptor> list = new ArrayList<> ();
    list.add(new ReadOnlyTextPropertyDescriptor(BASE_LOGGER_NAME_PROPERTY_ID, BASE_LOGGER_NAME_PROPERTY_NAME));
    list.add(new ReadOnlyTextPropertyDescriptor(BASE_LOGGER_DOMAIN_PROPERTY_ID, BASE_LOGGER_DOMAIN_PROPERTY_NAME));
    return list.toArray(new IPropertyDescriptor[list.size()]);
}
 
Example #16
Source File: PropertyPageAdapterFactory.java    From spotbugs with GNU Lesser General Public License v2.1 5 votes vote down vote up
public PropertySource(Object object) {
    this.object = object;
    List<IPropertyDescriptor> props = new ArrayList<>();
    List<Method> getters = getGetters(object);
    for (Method method : getters) {
        props.add(new PropertyDescriptor(method, getReadableName(method)));
    }
    propertyDescriptors = props.toArray(new PropertyDescriptor[0]);
}
 
Example #17
Source File: TmfAggregateAnalysisElement.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
    Set<TmfAnalysisElement> analyses = fContainedAnalyses;
    List<IPropertyDescriptor> descs = new ArrayList<>();
    for (TmfAnalysisElement analysis : analyses) {
        if (analysis.canExecute()) {
            descs.add(new ReadOnlyTextPropertyDescriptor(analysis.getResource(), analysis.getParent().getParent().getLabelText()));
        }
    }
    return descs.toArray(new IPropertyDescriptor[0]);
}
 
Example #18
Source File: ERTablePropertySource.java    From ermaster-b with Apache License 2.0 5 votes vote down vote up
public IPropertyDescriptor[] getPropertyDescriptors() {
	return new IPropertyDescriptor[] {
			new TextPropertyDescriptor("physicalName", ResourceString
					.getResourceString("label.physical.name")),
			new TextPropertyDescriptor("logicalName", ResourceString
					.getResourceString("label.logical.name")) };
}
 
Example #19
Source File: TraceSessionPropertySource.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
    List<IPropertyDescriptor> list = new ArrayList<>();
    list.add(new ReadOnlyTextPropertyDescriptor(TRACE_SESSION_NAME_PROPERTY_ID, TRACE_SESSION_NAME_PROPERTY_NAME));
    list.add(new ReadOnlyTextPropertyDescriptor(TRACE_SESSION_STATE_PROPERTY_ID, TRACE_SESSION_STATE_PROPERTY_NAME));
    if (fSession.isSnapshotSession()) {
        list.add(new ReadOnlyTextPropertyDescriptor(TRACE_SNAPSHOT_NAME_PROPERTY_ID, TRACE_SNAPSHOT_NAME_PROPERTY_NAME));
        list.add(new ReadOnlyTextPropertyDescriptor(TRACE_SNAPSHOT_PATH_PROPERTY_ID, TRACE_SNAPSHOT_PATH_PROPERTY_NAME));
        list.add(new ReadOnlyTextPropertyDescriptor(TRACE_SNAPSHOT_ID_PROPERTY_ID, TRACE_SNAPSHOT_ID_PROPERTY_NAME));
    } else {
        list.add(new ReadOnlyTextPropertyDescriptor(TRACE_SESSION_PATH_PROPERTY_ID, TRACE_SESSION_PATH_PROPERTY_NAME));
    }
    return(list.toArray(new IPropertyDescriptor[list.size()]));
}
 
Example #20
Source File: TraceDomainPropertySource.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
    if (fDomain.getBufferType() == BufferType.BUFFER_TYPE_UNKNOWN) {
        return new IPropertyDescriptor[] {
                new ReadOnlyTextPropertyDescriptor(TRACE_DOMAIN_NAME_PROPERTY_ID, TRACE_DOMAIN_NAME_PROPERTY_NAME) };
    }

    return new IPropertyDescriptor[] {
            new ReadOnlyTextPropertyDescriptor(TRACE_DOMAIN_NAME_PROPERTY_ID, TRACE_DOMAIN_NAME_PROPERTY_NAME),
            new ReadOnlyTextPropertyDescriptor(BUFFER_TYPE_PROPERTY_ID, BUFER_TYPE_PROPERTY_NAME) };
}
 
Example #21
Source File: TraceLoggerPropertySource.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
    List<IPropertyDescriptor> list = new ArrayList<>();
    list.add(new ReadOnlyTextPropertyDescriptor(TRACE_LOGGER_NAME_PROPERTY_ID, TRACE_LOGGER_NAME_PROPERTY_NAME));
    list.add(new ReadOnlyTextPropertyDescriptor(TRACE_LOGGER_STATE_PROPERTY_ID, TRACE_LOGGER_STATE_PROPERTY_NAME));
    if (!fLogger.getLogLevel().equals(TraceJulLogLevel.LEVEL_UNKNOWN) || !fLogger.getLogLevel().equals(TraceLog4jLogLevel.LEVEL_UNKNOWN)) {
        list.add(new ReadOnlyTextPropertyDescriptor(TRACE_LOGGER_LOGLEVEL_PROPERTY_ID, TRACE_LOGGER_LOGLEVEL_PROPERTY_NAME));
    }
    return list.toArray(new IPropertyDescriptor[list.size()]);
}
 
Example #22
Source File: BaseEventPropertySource.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
    List<IPropertyDescriptor> list = new ArrayList<> ();
    list.add(new ReadOnlyTextPropertyDescriptor(BASE_EVENT_NAME_PROPERTY_ID, BASE_EVENT_NAME_PROPERTY_NAME));
    list.add(new ReadOnlyTextPropertyDescriptor(BASE_EVENT_TYPE_PROPERTY_ID, BASE_EVENT_TYPE_PROPERTY_NAME));
    if (fBaseEvent.getLogLevel() != TraceLogLevel.LEVEL_UNKNOWN) {
        list.add(new ReadOnlyTextPropertyDescriptor(BASE_EVENT_LOGLEVEL_PROPERTY_ID, BASE_EVENT_LOGLEVEL_PROPERTY_NAME));
    }
    if (fBaseEvent.getFieldString() != null) {
        list.add(new ReadOnlyTextPropertyDescriptor(BASE_EVENT_FIELDS_PROPERTY_ID, BASE_EVENT_FIELDS_PROPERTY_NAME));
    }
    return list.toArray(new IPropertyDescriptor[list.size()]);
}
 
Example #23
Source File: TargetNodePropertySource.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
    return new IPropertyDescriptor[] {
            new ReadOnlyTextPropertyDescriptor(TARGET_NODE_NAME_PROPERTY_ID, TARGET_NODE_NAME_PROPERTY_NAME),
            new ReadOnlyTextPropertyDescriptor(TARGET_NODE_ADDRESS_PROPERTY_ID, TARGET_NODE_ADDRESS_PROPERTY_NAME),
            new ReadOnlyTextPropertyDescriptor(TARGET_NODE_STATE_PROPERTY_ID, TARGET_NODE_STATE_PROPERTY_NAME),
            new ReadOnlyTextPropertyDescriptor(TARGET_NODE_VERSION_PROPERTY_ID, TARGET_NODE_VERSION_PROPERTY_NAME)};
}
 
Example #24
Source File: BaseNode.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
public IPropertyDescriptor[] getPropertyDescriptors()
{
	List<IPropertyDescriptor> result = new ArrayList<IPropertyDescriptor>();

	for (P p : getPropertyInfoSet())
	{
		result.add(new PropertyDescriptor(p, p.getHeader()));
	}

	return result.toArray(new IPropertyDescriptor[result.size()]);
}
 
Example #25
Source File: ERDiagramPropertySource.java    From erflute with Apache License 2.0 5 votes vote down vote up
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {
    final List<String> dbList = DBManagerFactory.getAllDBList();

    return new IPropertyDescriptor[] { new ComboBoxPropertyDescriptor("database", DisplayMessages.getMessage("label.database"),
            dbList.toArray(new String[dbList.size()])) };
}
 
Example #26
Source File: CordovaPluginProperties.java    From thym with Eclipse Public License 1.0 5 votes vote down vote up
private static IPropertyDescriptor createPropertyDescriptor(String field, String label){
	PropertyDescriptor descriptor = new PropertyDescriptor(field, label);
	descriptor.setCategory("Cordova Plugin");
	descriptor.setAlwaysIncompatible(true);
	return descriptor;

	
}
 
Example #27
Source File: CordovaPlatformProperties.java    From thym with Eclipse Public License 1.0 5 votes vote down vote up
private static IPropertyDescriptor createPropertyDescriptor(String field, String label){
	PropertyDescriptor descriptor = new PropertyDescriptor(field, label);
	descriptor.setCategory("Cordova Platform");
	descriptor.setAlwaysIncompatible(true);
	return descriptor;

	
}
 
Example #28
Source File: MeshElementTreeViewPropertySource.java    From ice with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * This function returns the array of descriptors for properties.
 * 
 * @return The array of descriptors for properties.
 * 
 * @see IPropertySource#getPropertyDescriptors()
 */
@Override
public IPropertyDescriptor[] getPropertyDescriptors() {

	// Just get the descriptor array from the map
	return propDescMap.get(this.getWrappedData().getClass());

}
 
Example #29
Source File: CustomAdapterFactoryContentProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected IPropertySource createPropertySource(final Object object, IItemPropertySource itemPropertySource) {
    return new PropertySource(object, itemPropertySource){

        /*
         * (non-Javadoc)
         * @see org.eclipse.emf.edit.ui.provider.PropertySource#createPropertyDescriptor(org.eclipse.emf.edit.provider.IItemPropertyDescriptor)
         */
        @Override
        protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) {
            return new PropertyDescriptor(object, itemPropertyDescriptor) {

                /*
                 * (non-Javadoc)
                 * @see org.eclipse.emf.edit.ui.provider.PropertyDescriptor#createPropertyEditor(org.eclipse.swt.widgets.Composite)
                 */
                @Override
                public CellEditor createPropertyEditor(Composite composite) {
                    final Object feature = itemPropertyDescriptor.getFeature(this.object);
                    if (Objects.equals(feature, getCustomFeature())) {
                        return createCustomPropertyEditor(composite, object, itemPropertyDescriptor, getEditLabelProvider());
                    }
                    return super.createPropertyEditor(composite);
                }

            };
        }
    };
}
 
Example #30
Source File: ERDiagramPropertySource.java    From ermaster-b with Apache License 2.0 5 votes vote down vote up
public IPropertyDescriptor[] getPropertyDescriptors() {
	List<String> dbList = DBManagerFactory.getAllDBList();

	return new IPropertyDescriptor[] { new ComboBoxPropertyDescriptor(
			"database", ResourceString.getResourceString("label.database"),
			dbList.toArray(new String[dbList.size()])) };
}