use of org.knime.core.node.workflow.Credentials in project knime-core by knime.
the class CredentialVariableTable method createViewer.
private TableViewer createViewer(final Composite parent) {
TableViewer viewer = new TableViewer(parent, SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
TableViewerColumn nameCol = new TableViewerColumn(viewer, SWT.NONE);
nameCol.getColumn().setText(VAR_NAME);
nameCol.getColumn().setWidth(100);
TableViewerColumn loginCol = new TableViewerColumn(viewer, SWT.NONE);
loginCol.getColumn().setText(VAR_LOGIN);
loginCol.getColumn().setWidth(100);
TableViewerColumn typeCol = new TableViewerColumn(viewer, SWT.NONE);
typeCol.getColumn().setText(VAR_PASSWORD);
typeCol.getColumn().setWidth(100);
viewer.getTable().setHeaderVisible(true);
viewer.getTable().setLinesVisible(true);
viewer.setContentProvider(new IStructuredContentProvider() {
@Override
public Object[] getElements(final Object arg) {
return ((List<Credentials>) arg).toArray();
}
@Override
public void dispose() {
// do nothing -> images are static
}
@Override
public void inputChanged(final Viewer arg0, final Object arg1, final Object arg2) {
// do nothing
}
});
viewer.setLabelProvider(new WorkflowVariableLabelProvider());
viewer.setInput(m_params);
return viewer;
}
use of org.knime.core.node.workflow.Credentials in project knime-core by knime.
the class CredentialVariablesEditDialog method okPressed.
/**
* {@inheritDoc}
*/
@Override
protected void okPressed() {
String varName = m_name.getText().trim();
if (varName.isEmpty()) {
String msg = "Credential identifier must not be empty!";
showError(msg);
throw new OperationCanceledException(msg);
}
String name = m_name.getText();
String login = m_login.getText();
String pass = m_pass.getText();
m_credential = new Credentials(name, login, pass);
super.okPressed();
}
Aggregations