Search in sources :

Example 1 with GuiCompositeWidgetsAdapter

use of org.apache.hop.ui.core.gui.GuiCompositeWidgetsAdapter in project hop by apache.

the class MongoDbConnectionEditor method createControl.

@Override
public void createControl(Composite parent) {
    this.parent = parent;
    PropsUi props = PropsUi.getInstance();
    int margin = props.getMargin();
    int middle = props.getMiddlePct();
    // Name...
    // 
    Label wlName = new Label(parent, SWT.RIGHT);
    props.setLook(wlName);
    wlName.setText("MongoDB Connection name");
    FormData fdlName = new FormData();
    fdlName.top = new FormAttachment(0, margin * 2);
    fdlName.left = new FormAttachment(0, 0);
    fdlName.right = new FormAttachment(middle, 0);
    wlName.setLayoutData(fdlName);
    wName = new Text(parent, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wName);
    FormData fdName = new FormData();
    fdName.top = new FormAttachment(wlName, 0, SWT.CENTER);
    fdName.left = new FormAttachment(middle, margin);
    fdName.right = new FormAttachment(100, 0);
    wName.setLayoutData(fdName);
    // Rest of the widgets...
    // 
    widgets = new GuiCompositeWidgets(manager.getVariables());
    widgets.createCompositeWidgets(getMetadata(), null, parent, PARENT_WIDGET_ID, wName);
    // Set content on the widgets...
    // 
    setWidgetsContent();
    // Add changed listeners
    wName.addListener(SWT.Modify, e -> setChanged());
    widgets.setWidgetsListener(new GuiCompositeWidgetsAdapter() {

        @Override
        public void widgetModified(GuiCompositeWidgets compositeWidgets, Control changedWidget, String widgetId) {
            setChanged();
        }
    });
}
Also used : FormData(org.eclipse.swt.layout.FormData) GuiCompositeWidgets(org.apache.hop.ui.core.gui.GuiCompositeWidgets) GuiCompositeWidgetsAdapter(org.apache.hop.ui.core.gui.GuiCompositeWidgetsAdapter) FormAttachment(org.eclipse.swt.layout.FormAttachment) PropsUi(org.apache.hop.ui.core.PropsUi)

Example 2 with GuiCompositeWidgetsAdapter

use of org.apache.hop.ui.core.gui.GuiCompositeWidgetsAdapter in project hop by apache.

the class WorkflowRunConfigurationEditor method addGuiCompositeWidgets.

private void addGuiCompositeWidgets() {
    // 
    for (Control child : wPluginSpecificComp.getChildren()) {
        child.dispose();
    }
    // 
    if (workingConfiguration.getEngineRunConfiguration() != null) {
        guiCompositeWidgets = new GuiCompositeWidgets(manager.getVariables());
        guiCompositeWidgets.createCompositeWidgets(workingConfiguration.getEngineRunConfiguration(), null, wPluginSpecificComp, WorkflowRunConfiguration.GUI_PLUGIN_ELEMENT_PARENT_ID, null);
        guiCompositeWidgets.setWidgetsListener(new GuiCompositeWidgetsAdapter() {

            @Override
            public void widgetModified(GuiCompositeWidgets compositeWidgets, Control changedWidget, String widgetId) {
                setChanged();
            }
        });
    }
}
Also used : GuiCompositeWidgets(org.apache.hop.ui.core.gui.GuiCompositeWidgets) GuiCompositeWidgetsAdapter(org.apache.hop.ui.core.gui.GuiCompositeWidgetsAdapter)

Example 3 with GuiCompositeWidgetsAdapter

use of org.apache.hop.ui.core.gui.GuiCompositeWidgetsAdapter in project hop by apache.

the class PipelineRunConfigurationEditor method addGuiCompositeWidgets.

private void addGuiCompositeWidgets() {
    // 
    for (Control child : wPluginSpecificComp.getChildren()) {
        child.dispose();
    }
    if (workingConfiguration.getEngineRunConfiguration() != null) {
        guiCompositeWidgets = new GuiCompositeWidgets(manager.getVariables());
        guiCompositeWidgets.createCompositeWidgets(workingConfiguration.getEngineRunConfiguration(), null, wPluginSpecificComp, PipelineRunConfiguration.GUI_PLUGIN_ELEMENT_PARENT_ID, null);
        guiCompositeWidgets.setWidgetsListener(new GuiCompositeWidgetsAdapter() {

            @Override
            public void widgetModified(GuiCompositeWidgets compositeWidgets, Control changedWidget, String widgetId) {
                setChanged();
            }
        });
    }
}
Also used : GuiCompositeWidgets(org.apache.hop.ui.core.gui.GuiCompositeWidgets) GuiCompositeWidgetsAdapter(org.apache.hop.ui.core.gui.GuiCompositeWidgetsAdapter)

Example 4 with GuiCompositeWidgetsAdapter

use of org.apache.hop.ui.core.gui.GuiCompositeWidgetsAdapter in project hop by apache.

the class CassandraConnectionEditor method createControl.

@Override
public void createControl(Composite parent) {
    this.parent = parent;
    PropsUi props = PropsUi.getInstance();
    int margin = props.getMargin();
    int middle = props.getMiddlePct();
    // Name...
    // 
    // What's the name
    Label wlName = new Label(parent, SWT.RIGHT);
    props.setLook(wlName);
    wlName.setText("Cassandra connection name");
    FormData fdlName = new FormData();
    fdlName.top = new FormAttachment(0, margin * 2);
    fdlName.left = new FormAttachment(0, 0);
    fdlName.right = new FormAttachment(middle, 0);
    wlName.setLayoutData(fdlName);
    wName = new Text(parent, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    props.setLook(wName);
    FormData fdName = new FormData();
    fdName.top = new FormAttachment(wlName, 0, SWT.CENTER);
    fdName.left = new FormAttachment(middle, margin);
    fdName.right = new FormAttachment(100, 0);
    wName.setLayoutData(fdName);
    // Rest of the widgets...
    // 
    widgets = new GuiCompositeWidgets(manager.getVariables());
    widgets.createCompositeWidgets(getMetadata(), null, parent, PARENT_WIDGET_ID, wName);
    // Set content on the widgets...
    // 
    setWidgetsContent();
    // Add changed listeners
    wName.addListener(SWT.Modify, e -> setChanged());
    widgets.setWidgetsListener(new GuiCompositeWidgetsAdapter() {

        @Override
        public void widgetModified(GuiCompositeWidgets compositeWidgets, Control changedWidget, String widgetId) {
            setChanged();
        }
    });
}
Also used : FormData(org.eclipse.swt.layout.FormData) GuiCompositeWidgets(org.apache.hop.ui.core.gui.GuiCompositeWidgets) GuiCompositeWidgetsAdapter(org.apache.hop.ui.core.gui.GuiCompositeWidgetsAdapter) FormAttachment(org.eclipse.swt.layout.FormAttachment) PropsUi(org.apache.hop.ui.core.PropsUi)

Example 5 with GuiCompositeWidgetsAdapter

use of org.apache.hop.ui.core.gui.GuiCompositeWidgetsAdapter in project hop by apache.

the class DatabaseMetaEditor method changeConnectionType.

private void changeConnectionType() {
    if (busyChangingConnectionType.get()) {
        return;
    }
    busyChangingConnectionType.set(true);
    DatabaseMeta databaseMeta = this.getMetadata();
    // Capture any information on the widgets
    // 
    this.getWidgetsContent(databaseMeta);
    // Save the state of this type so we can switch back and forth
    metaMap.put(databaseMeta.getIDatabase().getClass(), databaseMeta.getIDatabase());
    // Now change the data type
    // 
    databaseMeta.setDatabaseType(wConnectionType.getText());
    // Get possible information from the metadata map (from previous work)
    // 
    databaseMeta.setIDatabase(metaMap.get(databaseMeta.getIDatabase().getClass()));
    // 
    for (Control child : wDatabaseSpecificComp.getChildren()) {
        child.dispose();
    }
    // Re-add the widgets
    // 
    guiCompositeWidgets = new GuiCompositeWidgets(manager.getVariables());
    guiCompositeWidgets.createCompositeWidgets(databaseMeta.getIDatabase(), null, wDatabaseSpecificComp, DatabaseMeta.GUI_PLUGIN_ELEMENT_PARENT_ID, null);
    guiCompositeWidgets.setWidgetsListener(new GuiCompositeWidgetsAdapter() {

        @Override
        public void widgetModified(GuiCompositeWidgets compositeWidgets, Control changedWidget, String widgetId) {
            setChanged();
        }
    });
    addCompositeWidgetsUsernamePassword();
    // Put the data back
    // 
    setWidgetsContent();
    wGeneralComp.layout(true, true);
    busyChangingConnectionType.set(false);
}
Also used : GuiCompositeWidgets(org.apache.hop.ui.core.gui.GuiCompositeWidgets) GuiCompositeWidgetsAdapter(org.apache.hop.ui.core.gui.GuiCompositeWidgetsAdapter)

Aggregations

GuiCompositeWidgets (org.apache.hop.ui.core.gui.GuiCompositeWidgets)7 GuiCompositeWidgetsAdapter (org.apache.hop.ui.core.gui.GuiCompositeWidgetsAdapter)7 FormAttachment (org.eclipse.swt.layout.FormAttachment)4 FormData (org.eclipse.swt.layout.FormData)4 PropsUi (org.apache.hop.ui.core.PropsUi)3 FormLayout (org.eclipse.swt.layout.FormLayout)2 TextVar (org.apache.hop.ui.core.widget.TextVar)1 CTabItem (org.eclipse.swt.custom.CTabItem)1 Composite (org.eclipse.swt.widgets.Composite)1 Control (org.eclipse.swt.widgets.Control)1 Label (org.eclipse.swt.widgets.Label)1 Text (org.eclipse.swt.widgets.Text)1