use of org.talend.repository.hadoopcluster.ui.dynamic.DynamicModuleGroupData in project tbd-studio-se by Talend.
the class ModuleGroupDetailsForm method onAddBtnSelected.
protected void onAddBtnSelected() {
DynamicModuleGroupData moduleGroupData = getModuleGroupData();
String groupTemplateId = moduleGroupData.getGroupTemplateId();
DynamicPluginAdapter pluginAdapter = moduleGroupData.getPluginAdapter();
IDynamicConfiguration moduleGroup = pluginAdapter.getModuleGroupByTemplateId(groupTemplateId);
// IDynamicPluginConfiguration pluginConfiguration = pluginAdapter.getPluginConfiguration();
// String id = pluginConfiguration.getId();
// String moduleName = "Not set"; //$NON-NLS-1$
// String runtimeId = DynamicDistributionUtils.getPluginKey("USER", "GENERATED", id, moduleName); //$NON-NLS-1$
// //$NON-NLS-2$
// $NON-NLS-1$
String runtimeId = "";
IDynamicConfiguration dynamicLibrary = DynamicModuleGroupAdapter.createDynamicLibrary(runtimeId);
List<IDynamicConfiguration> childConfigurations = moduleGroup.getChildConfigurations();
childConfigurations.add(dynamicLibrary);
groupDetailsViewer.refresh();
}
use of org.talend.repository.hadoopcluster.ui.dynamic.DynamicModuleGroupData in project tbd-studio-se by Talend.
the class ModuleGroupDetailsForm method getMavenUri.
protected String getMavenUri(Object element) {
if (element instanceof IDynamicConfiguration) {
try {
String id = (String) ((IDynamicConfiguration) element).getAttribute(DynamicModuleGroupAdapter.ATTR_LIBRARY_ID);
DynamicModuleGroupData moduleGroupData = getModuleGroupData();
DynamicPluginAdapter pluginAdapter = moduleGroupData.getPluginAdapter();
IDynamicConfiguration moduleById = pluginAdapter.getModuleById(id);
String mvnUri = null;
if (moduleById == null) {
// should be an existing module in studio, or a bad one
ModuleNeeded moduleNeeded = HadoopDistributionPlugin.getInstance().getExistingModuleMap().get(id);
if (moduleNeeded != null) {
mvnUri = moduleNeeded.getMavenUri();
} else {
mvnUri = id;
}
} else {
mvnUri = (String) moduleById.getAttribute(DynamicModuleAdapter.ATTR_MVN_URI);
}
return mvnUri;
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
// $NON-NLS-1$
return "";
}
use of org.talend.repository.hadoopcluster.ui.dynamic.DynamicModuleGroupData in project tbd-studio-se by Talend.
the class ModuleGroupDetailsForm method initData.
protected void initData() {
try {
DynamicModuleGroupData moduleGroupData = getModuleGroupData();
String groupTemplateId = moduleGroupData.getGroupTemplateId();
groupTemplateIdLabel.setText(// $NON-NLS-1$
Messages.getString("ModuleGroupDetailsForm.groupDetails.label.groupTemplateId", groupTemplateId));
DynamicPluginAdapter pluginAdapter = moduleGroupData.getPluginAdapter();
IDynamicConfiguration moduleGroup = pluginAdapter.getModuleGroupByTemplateId(groupTemplateId);
List<IDynamicConfiguration> childConfigurations = moduleGroup.getChildConfigurations();
if (childConfigurations != null) {
Collections.sort(childConfigurations, new DynamicAttributeComparator());
}
groupDetailsViewer.setInput(childConfigurations);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
use of org.talend.repository.hadoopcluster.ui.dynamic.DynamicModuleGroupData in project tbd-studio-se by Talend.
the class ModuleGroupDetailsForm method onDeleteBtnSelected.
protected void onDeleteBtnSelected() {
IStructuredSelection selection = (IStructuredSelection) groupDetailsViewer.getSelection();
IDynamicConfiguration firstElement = (IDynamicConfiguration) selection.getFirstElement();
DynamicModuleGroupData moduleGroupData = getModuleGroupData();
String groupTemplateId = moduleGroupData.getGroupTemplateId();
DynamicPluginAdapter pluginAdapter = moduleGroupData.getPluginAdapter();
IDynamicConfiguration moduleGroup = pluginAdapter.getModuleGroupByTemplateId(groupTemplateId);
List<IDynamicConfiguration> childConfigurations = moduleGroup.getChildConfigurations();
childConfigurations.remove(firstElement);
groupDetailsViewer.refresh();
}
Aggregations