use of org.jboss.tools.openshift.internal.ui.wizard.newapp.fromtemplate.TemplateParameterViewerUtils.ParameterNameViewerComparator in project jbosstools-openshift by jbosstools.
the class NewApplicationSummaryFromTemplateDialog method createTable.
public TableViewer createTable(Composite tableContainer) {
Table table = new Table(tableContainer, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
table.setLinesVisible(true);
table.setHeaderVisible(true);
ICellToolTipProvider<IParameter> cellToolTipProvider = new ICellToolTipProvider<IParameter>() {
@Override
public String getToolTipText(IParameter object) {
return object.getDescription();
}
@Override
public int getToolTipDisplayDelayTime(IParameter object) {
return 0;
}
};
TableViewer viewer = new TableViewerBuilder(table, tableContainer).contentProvider(new ArrayContentProvider()).column(new IColumnLabelProvider<IParameter>() {
@Override
public String getValue(IParameter variable) {
return variable.getName();
}
}).cellToolTipProvider(cellToolTipProvider).name("Name").align(SWT.LEFT).weight(2).minWidth(100).buildColumn().column(new IColumnLabelProvider<IParameter>() {
@Override
public String getValue(IParameter parameter) {
return TemplateParameterViewerUtils.getValueLabel(parameter);
}
}).cellToolTipProvider(cellToolTipProvider).name("Value").align(SWT.LEFT).weight(2).minWidth(100).buildColumn().buildViewer();
viewer.setComparator(new ParameterNameViewerComparator());
viewer.addDoubleClickListener(onDoubleClick(table));
return viewer;
}
Aggregations