use of org.eclipse.ui.forms.widgets.TableWrapData in project netxms by netxms.
the class FilterBuilder method createConditionSection.
/**
* Create condition section
*/
private void createConditionSection() {
condition = toolkit.createSection(form.getBody(), Section.TITLE_BAR);
condition.setText(Messages.get().FilterBuilder_Condition);
TableWrapData twd = new TableWrapData();
twd.grabHorizontal = true;
twd.align = TableWrapData.FILL;
condition.setLayoutData(twd);
final Composite clientArea = toolkit.createComposite(condition);
GridLayout layout = new GridLayout();
clientArea.setLayout(layout);
condition.setClient(clientArea);
addColumnLink = toolkit.createImageHyperlink(clientArea, SWT.NONE);
addColumnLink.setText(Messages.get().FilterBuilder_AddColumn);
addColumnLink.setImage(SharedIcons.IMG_ADD_OBJECT);
addColumnLink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
addColumnToFilter(addColumnLink, addColumnLink);
}
});
}
use of org.eclipse.ui.forms.widgets.TableWrapData in project netxms by netxms.
the class FilterBuilder method createOrderingSection.
/**
* Create ordering section
*/
private void createOrderingSection() {
ordering = toolkit.createSection(form.getBody(), Section.TITLE_BAR);
ordering.setText(Messages.get().FilterBuilder_Ordering);
TableWrapData twd = new TableWrapData();
twd.grabHorizontal = false;
twd.align = TableWrapData.FILL;
ordering.setLayoutData(twd);
final Composite clientArea = toolkit.createComposite(ordering);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
clientArea.setLayout(layout);
ordering.setClient(clientArea);
orderingList = new TableViewer(clientArea, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
toolkit.adapt(orderingList.getTable());
TableViewerColumn column = new TableViewerColumn(orderingList, SWT.LEFT);
column.getColumn().setText(Messages.get().FilterBuilder_Column);
column.getColumn().setWidth(200);
column = new TableViewerColumn(orderingList, SWT.LEFT);
column.getColumn().setText(Messages.get().FilterBuilder_Descending);
column.getColumn().setWidth(60);
column.setEditingSupport(new OrderingColumnEditingSupport(orderingList));
orderingList.getTable().setLinesVisible(true);
orderingList.getTable().setHeaderVisible(true);
orderingList.setContentProvider(new ArrayContentProvider());
orderingList.setLabelProvider(new OrderingListLabelProvider());
orderingList.setInput(orderingColumns.toArray());
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.verticalSpan = 2;
gd.heightHint = 60;
orderingList.getControl().setLayoutData(gd);
final ImageHyperlink linkAdd = toolkit.createImageHyperlink(clientArea, SWT.NONE);
linkAdd.setText(Messages.get().FilterBuilder_Add);
linkAdd.setImage(SharedIcons.IMG_ADD_OBJECT);
linkAdd.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
addSortingColumn(linkAdd);
}
});
gd = new GridData();
gd.verticalAlignment = SWT.TOP;
linkAdd.setLayoutData(gd);
final ImageHyperlink linkRemove = toolkit.createImageHyperlink(clientArea, SWT.NONE);
linkRemove.setText(Messages.get().FilterBuilder_Remove);
linkRemove.setImage(SharedIcons.IMG_DELETE_OBJECT);
linkRemove.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
removeSortingColumn();
}
});
gd = new GridData();
gd.verticalAlignment = SWT.TOP;
linkRemove.setLayoutData(gd);
linkRemove.setEnabled(false);
orderingList.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
linkRemove.setEnabled(!orderingList.getSelection().isEmpty());
}
});
}
use of org.eclipse.ui.forms.widgets.TableWrapData in project netxms by netxms.
the class ExportFileBuilder method createFileSection.
/**
* Create "File" section
*/
private void createFileSection() {
Section section = toolkit.createSection(form.getBody(), Section.TITLE_BAR);
section.setText(Messages.get().ExportFileBuilder_SectionFile);
TableWrapData td = new TableWrapData();
td.align = TableWrapData.FILL;
td.grabHorizontal = true;
td.colspan = 2;
section.setLayoutData(td);
Composite clientArea = toolkit.createComposite(section);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
clientArea.setLayout(layout);
section.setClient(clientArea);
description = new LabeledText(clientArea, SWT.NONE, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
toolkit.adapt(description);
description.setLabel(Messages.get().ExportFileBuilder_Description);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;
gd.heightHint = 200;
description.setLayoutData(gd);
}
use of org.eclipse.ui.forms.widgets.TableWrapData in project netxms by netxms.
the class ExportFileBuilder method createSummaryTablesSection.
/**
* Create "Summary Tables" section
*/
private void createSummaryTablesSection() {
Section section = toolkit.createSection(form.getBody(), Section.TITLE_BAR);
section.setText("DCI Summary Tables");
TableWrapData td = new TableWrapData();
td.align = TableWrapData.FILL;
td.grabHorizontal = true;
section.setLayoutData(td);
Composite clientArea = toolkit.createComposite(section);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
clientArea.setLayout(layout);
section.setClient(clientArea);
summaryTableViewer = new TableViewer(clientArea, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
toolkit.adapt(ruleViewer.getTable());
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessVerticalSpace = true;
gd.heightHint = 200;
gd.verticalSpan = 2;
summaryTableViewer.getTable().setLayoutData(gd);
summaryTableViewer.setContentProvider(new ArrayContentProvider());
summaryTableViewer.setLabelProvider(new SummaryTablesLabelProvider());
summaryTableViewer.setComparator(new SummaryTablesComparator());
summaryTableViewer.getTable().setSortDirection(SWT.UP);
final ImageHyperlink linkAdd = toolkit.createImageHyperlink(clientArea, SWT.NONE);
linkAdd.setText(Messages.get().ExportFileBuilder_Add);
linkAdd.setImage(SharedIcons.IMG_ADD_OBJECT);
gd = new GridData();
gd.verticalAlignment = SWT.TOP;
linkAdd.setLayoutData(gd);
linkAdd.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
addSummaryTables();
}
});
final ImageHyperlink linkRemove = toolkit.createImageHyperlink(clientArea, SWT.NONE);
linkRemove.setText(Messages.get().ExportFileBuilder_Remove);
linkRemove.setImage(SharedIcons.IMG_DELETE_OBJECT);
gd = new GridData();
gd.verticalAlignment = SWT.TOP;
linkRemove.setLayoutData(gd);
linkRemove.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
removeObjects(summaryTableViewer, summaryTables);
}
});
}
use of org.eclipse.ui.forms.widgets.TableWrapData in project netxms by netxms.
the class ExportFileBuilder method createTemplateSection.
/**
* Create "Templates" section
*/
private void createTemplateSection() {
Section section = toolkit.createSection(form.getBody(), Section.TITLE_BAR);
section.setText(Messages.get().ExportFileBuilder_SectionTemplates);
TableWrapData td = new TableWrapData();
td.align = TableWrapData.FILL;
td.grabHorizontal = true;
section.setLayoutData(td);
Composite clientArea = toolkit.createComposite(section);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
clientArea.setLayout(layout);
section.setClient(clientArea);
templateViewer = new TableViewer(clientArea, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
toolkit.adapt(templateViewer.getTable());
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessVerticalSpace = true;
gd.heightHint = 200;
gd.verticalSpan = 2;
templateViewer.getTable().setLayoutData(gd);
templateViewer.setContentProvider(new ArrayContentProvider());
templateViewer.setLabelProvider(new WorkbenchLabelProvider());
templateViewer.setComparator(new ObjectLabelComparator((ILabelProvider) templateViewer.getLabelProvider()));
templateViewer.getTable().setSortDirection(SWT.UP);
final ImageHyperlink linkAdd = toolkit.createImageHyperlink(clientArea, SWT.NONE);
linkAdd.setText(Messages.get().ExportFileBuilder_Add);
linkAdd.setImage(SharedIcons.IMG_ADD_OBJECT);
gd = new GridData();
gd.verticalAlignment = SWT.TOP;
linkAdd.setLayoutData(gd);
linkAdd.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
addTemplates();
}
});
final ImageHyperlink linkRemove = toolkit.createImageHyperlink(clientArea, SWT.NONE);
linkRemove.setText(Messages.get().ExportFileBuilder_Remove);
linkRemove.setImage(SharedIcons.IMG_DELETE_OBJECT);
gd = new GridData();
gd.verticalAlignment = SWT.TOP;
linkRemove.setLayoutData(gd);
linkRemove.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
removeObjects(templateViewer, templates);
}
});
}
Aggregations