use of eu.esdihumboldt.hale.io.appschema.ui.FeatureChainingConfigurationPage.ChainPage in project hale by halestudio.
the class WorkspaceConfigurationPage method createContent.
/**
* @see eu.esdihumboldt.hale.ui.HaleWizardPage#createContent(org.eclipse.swt.widgets.Composite)
*/
@Override
protected void createContent(Composite page) {
Composite main = new Composite(page, SWT.NONE);
main.setLayout(new GridLayout(3, false));
Composite tableParent = new Composite(main, SWT.NONE);
TableColumnLayout layout = new TableColumnLayout();
tableParent.setLayout(layout);
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 2);
gridData.minimumHeight = 150;
tableParent.setLayoutData(gridData);
workspaceTableViewer = new TableViewer(tableParent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
workspaceTableViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 2));
workspaceTableViewer.setContentProvider(ArrayContentProvider.getInstance());
workspaceTableViewer.getTable().setHeaderVisible(true);
workspaceTableViewer.getTable().setLinesVisible(true);
// disable selection on table viewer
workspaceTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(final SelectionChangedEvent event) {
// prevent selection
if (!event.getSelection().isEmpty()) {
workspaceTableViewer.setSelection(StructuredSelection.EMPTY);
}
}
});
TableViewerColumn nameColumn = new TableViewerColumn(workspaceTableViewer, SWT.NONE);
layout.setColumnData(nameColumn.getColumn(), new ColumnWeightData(2, true));
nameColumn.setLabelProvider(new WorkspaceNameLabelProvider());
nameColumn.getColumn().setText("Name");
nameColumn.setEditingSupport(new WorkspaceNameEditingSupport(workspaceTableViewer));
TableViewerColumn isolatedColumn = new TableViewerColumn(workspaceTableViewer, SWT.NONE);
layout.setColumnData(isolatedColumn.getColumn(), new ColumnWeightData(1, true));
isolatedColumn.setLabelProvider(new WorkspaceIsolatedLabelProvider());
isolatedColumn.getColumn().setText("Isolated");
isolatedColumn.setEditingSupport(new WorkspaceIsolatedEditingSupport(workspaceTableViewer));
TableViewerColumn namespaceColumn = new TableViewerColumn(workspaceTableViewer, SWT.NONE);
layout.setColumnData(namespaceColumn.getColumn(), new ColumnWeightData(3, true));
namespaceColumn.setLabelProvider(new WorkspaceNamespaceLabelProvider());
namespaceColumn.getColumn().setText("Namespace");
TableViewerColumn featuresColumn = new TableViewerColumn(workspaceTableViewer, SWT.NONE);
layout.setColumnData(featuresColumn.getColumn(), new ColumnWeightData(3, true));
featuresColumn.setLabelProvider(new WorkspaceFeaturesLabelProvider());
featuresColumn.getColumn().setText("Features");
IWizardContainer container = getContainer();
if (container instanceof WizardDialog) {
changeListener = new IPageChangingListener() {
@Override
public void handlePageChanging(PageChangingEvent event) {
Object currentPage = event.getCurrentPage();
Object targetPage = event.getTargetPage();
if ((currentPage instanceof FeatureChainingConfigurationPage || currentPage instanceof ChainPage) && targetPage instanceof WorkspaceConfigurationPage) {
goingBack = false;
} else if (currentPage instanceof AppSchemaDataStoreConfigurationPage && targetPage instanceof WorkspaceConfigurationPage) {
goingBack = true;
}
}
};
WizardDialog dialog = (WizardDialog) container;
dialog.addPageChangingListener(changeListener);
} else {
changeListener = null;
}
}
Aggregations