Search in sources :

Example 1 with IGenericWizardInternalService

use of org.talend.repository.generic.internal.IGenericWizardInternalService 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);
    }
}
Also used : ComponentProperties(org.talend.components.api.properties.ComponentProperties) Form(org.talend.daikon.properties.presentation.Form) GenericWizardInternalService(org.talend.repository.generic.internal.service.GenericWizardInternalService) IGenericWizardInternalService(org.talend.repository.generic.internal.IGenericWizardInternalService) Image(org.eclipse.swt.graphics.Image) ComponentWizard(org.talend.components.api.wizard.ComponentWizard) IGenericWizardInternalService(org.talend.repository.generic.internal.IGenericWizardInternalService) ERepositoryObjectType(org.talend.core.model.repository.ERepositoryObjectType) GenericConnectionItem(org.talend.repository.generic.model.genericMetadata.GenericConnectionItem)

Example 2 with IGenericWizardInternalService

use of org.talend.repository.generic.internal.IGenericWizardInternalService 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;
}
Also used : ComponentWizard(org.talend.components.api.wizard.ComponentWizard) ComponentProperties(org.talend.components.api.properties.ComponentProperties) IGenericWizardInternalService(org.talend.repository.generic.internal.IGenericWizardInternalService) GenericWizardInternalService(org.talend.repository.generic.internal.service.GenericWizardInternalService) IGenericWizardInternalService(org.talend.repository.generic.internal.IGenericWizardInternalService)

Aggregations

ComponentProperties (org.talend.components.api.properties.ComponentProperties)2 ComponentWizard (org.talend.components.api.wizard.ComponentWizard)2 IGenericWizardInternalService (org.talend.repository.generic.internal.IGenericWizardInternalService)2 GenericWizardInternalService (org.talend.repository.generic.internal.service.GenericWizardInternalService)2 Image (org.eclipse.swt.graphics.Image)1 ERepositoryObjectType (org.talend.core.model.repository.ERepositoryObjectType)1 Form (org.talend.daikon.properties.presentation.Form)1 GenericConnectionItem (org.talend.repository.generic.model.genericMetadata.GenericConnectionItem)1