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();
}
});
}
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();
}
});
}
}
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();
}
});
}
}
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();
}
});
}
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);
}
Aggregations