Search in sources :

Example 1 with IdMatchingLabelProvider

use of org.netxms.ui.eclipse.dashboard.dialogs.helpers.IdMatchingLabelProvider 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;
}
Also used : SortableTreeViewer(org.netxms.ui.eclipse.widgets.SortableTreeViewer) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) IdMatchingContentProvider(org.netxms.ui.eclipse.dashboard.dialogs.helpers.IdMatchingContentProvider) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) IdMatchingLabelProvider(org.netxms.ui.eclipse.dashboard.dialogs.helpers.IdMatchingLabelProvider)

Aggregations

GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 Label (org.eclipse.swt.widgets.Label)1 IdMatchingContentProvider (org.netxms.ui.eclipse.dashboard.dialogs.helpers.IdMatchingContentProvider)1 IdMatchingLabelProvider (org.netxms.ui.eclipse.dashboard.dialogs.helpers.IdMatchingLabelProvider)1 SortableTreeViewer (org.netxms.ui.eclipse.widgets.SortableTreeViewer)1