use of org.talend.repository.generic.internal.service.GenericWizardInternalService in project tdi-studio-se by Talend.
the class GenericConnWizard method addPages.
@Override
public void addPages() {
ERepositoryObjectType repObjType = (ERepositoryObjectType) repNode.getProperties(EProperties.CONTENT_TYPE);
String typeName = repObjType.getType();
setWindowTitle(typeName);
Image wiardImage = wizardService.getWiardImage(typeName);
setDefaultPageImageDescriptor(ImageDescriptor.createFromImage(wiardImage));
((GenericConnectionItem) connectionItem).setTypeName(typeName);
IGenericWizardInternalService internalService = new GenericWizardInternalService();
ComponentWizard componentWizard = null;
if (creation) {
componentWizard = internalService.getComponentWizard(typeName, connectionProperty.getId());
} else {
String compPropertiesStr = connection.getCompProperties();
if (compPropertiesStr != null) {
ComponentProperties properties = ComponentsUtils.getComponentPropertiesFromSerialized(compPropertiesStr, connection, false);
if (properties != null) {
componentWizard = internalService.getTopLevelComponentWizard(properties, repNode.getId());
}
}
}
if (componentWizard == null) {
return;
}
List<Form> forms = componentWizard.getForms();
for (int i = 0; i < forms.size(); i++) {
Form form = forms.get(i);
boolean addContextSupport = false;
if (i == 0) {
// Add context support in the first form.
addContextSupport = true;
}
wizPage = new GenericConnWizardPage(connectionItem, isRepositoryObjectEditable(), existingNames, creation, form, compService, addContextSupport);
if (wizPage != null) {
wizPage.setTitle(form.getTitle());
wizPage.setDescription(form.getSubtitle());
if (creation) {
wizPage.setPageComplete(false);
} else {
wizPage.setPageComplete(isRepositoryObjectEditable());
}
}
addPage(wizPage);
}
}
use of org.talend.repository.generic.internal.service.GenericWizardInternalService in project tdi-studio-se by Talend.
the class CreateGenericConnectionAction method doRun.
@Override
protected void doRun() {
IWizard wizard = new GenericConnWizard(PlatformUI.getWorkbench(), creation, repositoryNode, getExistingNames());
WizardDialog wizardDialog = new GenericWizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wizard, new GenericWizardInternalService().getComponentService());
if (Platform.getOS().equals(Platform.OS_LINUX)) {
wizardDialog.setPageSize(getWizardWidth(), getWizardHeight() + 80);
}
wizardDialog.create();
wizardDialog.open();
}
use of org.talend.repository.generic.internal.service.GenericWizardInternalService in project tdi-studio-se by Talend.
the class GenericDragAndDropHandler method getComponentMainName.
private String getComponentMainName(GenericConnection connection) {
IGenericWizardInternalService internalService = new GenericWizardInternalService();
ComponentWizard componentWizard = null;
String compPropertiesStr = connection.getCompProperties();
if (compPropertiesStr != null) {
ComponentProperties properties = ComponentsUtils.getComponentPropertiesFromSerialized(compPropertiesStr, connection);
if (properties != null) {
componentWizard = internalService.getTopLevelComponentWizard(properties, null);
}
}
if (componentWizard != null) {
return StringUtils.capitalize(componentWizard.getDefinition().getName());
}
return null;
}
Aggregations