提交 e90a15b8 编写于 作者: S serge-rider

Data type descriptor fix

上级 b57d5ac0
......@@ -39,7 +39,7 @@ public abstract class DataTypeAbstractDescriptor<DESCRIPTOR> extends AbstractDes
public static final String ALL_TYPES_PATTERN = "*";
private final Class<DESCRIPTOR> instanceType;
protected String id;
private final String id;
private ObjectType implType;
private Set<Object> supportedTypes = new HashSet<>();
private List<String> supportedDataSources = new ArrayList<>();
......@@ -136,7 +136,7 @@ public abstract class DataTypeAbstractDescriptor<DESCRIPTOR> extends AbstractDes
return implType.createInstance(instanceType);
}
catch (Exception e) {
throw new IllegalStateException("Can't instantiate data type provider '" + this.id + "'", e); //$NON-NLS-1$
throw new IllegalStateException("Can't instantiate data type provider '" + this.getId() + "'", e); //$NON-NLS-1$
}
}
......
......@@ -38,6 +38,7 @@ public class MockGeneratorDescriptor extends DataTypeAbstractDescriptor<MockValu
public static final String TAG_PRESET = "preset"; //NON-NLS-1
private Preset preset;
private String label;
private String description;
private final String link;
......@@ -73,7 +74,7 @@ public class MockGeneratorDescriptor extends DataTypeAbstractDescriptor<MockValu
public MockGeneratorDescriptor(IConfigurationElement config, Preset preset) {
this(config);
this.id += "_" + preset.id;
this.preset = preset;
this.label = " " + preset.label;
if (!CommonUtils.isEmpty(preset.description)) {
this.description = preset.description;
......@@ -93,6 +94,15 @@ public class MockGeneratorDescriptor extends DataTypeAbstractDescriptor<MockValu
}
@Override
public String getId() {
if (preset != null) {
return super.getId() + "_" + preset.id;
} else {
return super.getId();
}
}
public String getLabel() {
return label;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册