Search in sources :

Example 1 with GenericWizardInternalService

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);
    }
}
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 GenericWizardInternalService

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();
}
Also used : IWizard(org.eclipse.jface.wizard.IWizard) GenericWizardDialog(org.talend.repository.generic.ui.common.GenericWizardDialog) GenericWizardInternalService(org.talend.repository.generic.internal.service.GenericWizardInternalService) GenericWizardDialog(org.talend.repository.generic.ui.common.GenericWizardDialog) WizardDialog(org.eclipse.jface.wizard.WizardDialog) GenericConnWizard(org.talend.repository.generic.ui.GenericConnWizard)

Example 3 with GenericWizardInternalService

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;
}
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

GenericWizardInternalService (org.talend.repository.generic.internal.service.GenericWizardInternalService)3 ComponentProperties (org.talend.components.api.properties.ComponentProperties)2 ComponentWizard (org.talend.components.api.wizard.ComponentWizard)2 IGenericWizardInternalService (org.talend.repository.generic.internal.IGenericWizardInternalService)2 IWizard (org.eclipse.jface.wizard.IWizard)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1 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 GenericConnWizard (org.talend.repository.generic.ui.GenericConnWizard)1 GenericWizardDialog (org.talend.repository.generic.ui.common.GenericWizardDialog)1