use of org.netxms.ui.eclipse.dashboard.dialogs.helpers.IdMatchingContentProvider in project netxms by netxms.
the class IdMatchingDialog method createDialogArea.
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createDialogArea(Composite parent) {
Composite dialogArea = (Composite) super.createDialogArea(parent);
GridLayout layout = new GridLayout();
layout.marginWidth = WidgetHelper.DIALOG_WIDTH_MARGIN;
layout.marginHeight = WidgetHelper.DIALOG_HEIGHT_MARGIN;
dialogArea.setLayout(layout);
Label label = new Label(dialogArea, SWT.WRAP);
label.setText(Messages.get().IdMatchingDialog_HelpText);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.widthHint = 0;
label.setLayoutData(gd);
final String[] names = { Messages.get().IdMatchingDialog_ColumnOriginalID, Messages.get().IdMatchingDialog_ColumnName, Messages.get().IdMatchingDialog_ColumnMatchID, Messages.get().IdMatchingDialog_ColumnMatchName };
final int[] widths = { 100, 300, 80, 300 };
viewer = new SortableTreeViewer(dialogArea, names, widths, 0, SWT.UP, SWT.BORDER | SWT.SINGLE | SWT.FULL_SELECTION);
viewer.getTree().setLinesVisible(true);
viewer.getTree().setHeaderVisible(true);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessVerticalSpace = true;
gd.heightHint = 400;
viewer.getControl().setLayoutData(gd);
viewer.setContentProvider(new IdMatchingContentProvider());
viewer.setLabelProvider(new IdMatchingLabelProvider());
viewer.setInput(new Object[] { objects, dcis });
viewer.expandAll();
createActions();
createPopupMenu();
return dialogArea;
}
Aggregations