use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.
the class ConditionEditor method initialize.
/**
* Initialize editor
*/
public void initialize(ColumnFilter initialFilter) {
GridLayout layout = new GridLayout();
layout.numColumns = 4;
setLayout(layout);
logicalOperation = new Label(this, SWT.NONE);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.CENTER;
gd.widthHint = 30;
logicalOperation.setLayoutData(gd);
operation = new Combo(this, SWT.READ_ONLY);
toolkit.adapt(operation);
for (String s : getOperations()) operation.add(s);
operation.select(0);
operation.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
operationSelectionChanged(operation.getSelectionIndex());
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
});
createContent(this, initialFilter);
ImageHyperlink link = new ImageHyperlink(this, SWT.NONE);
link.setImage(SharedIcons.IMG_DELETE_OBJECT);
link.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
ConditionEditor.this.dispose();
deleteHandler.run();
}
});
layout(true, true);
}
use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.
the class ObjectConditionEditor method createContent.
/* (non-Javadoc)
* @see org.netxms.ui.eclipse.logviewer.widgets.ConditionEditor#createContent(org.eclipse.swt.widgets.Composite)
*/
@Override
protected void createContent(Composite parent, ColumnFilter initialFilter) {
Composite group = new Composite(this, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
layout.horizontalSpacing = WidgetHelper.INNER_SPACING;
layout.numColumns = 2;
group.setLayout(layout);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
group.setLayoutData(gd);
objectName = new CLabel(group, SWT.NONE);
toolkit.adapt(objectName);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.verticalAlignment = SWT.TOP;
objectName.setLayoutData(gd);
objectName.setText(EMPTY_SELECTION_TEXT);
final ImageHyperlink selectionLink = toolkit.createImageHyperlink(group, SWT.NONE);
selectionLink.setImage(SharedIcons.IMG_FIND);
selectionLink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
selectObject();
}
});
if (initialFilter != null) {
switch(initialFilter.getType()) {
case EQUALS:
setSelectedOperation(initialFilter.isNegated() ? 1 : 0);
objectId = initialFilter.getNumericValue();
break;
case CHILDOF:
setSelectedOperation(initialFilter.isNegated() ? 3 : 2);
objectId = initialFilter.getNumericValue();
break;
default:
break;
}
if (objectId != 0) {
AbstractObject object = ConsoleSharedData.getSession().findObjectById(objectId);
if (object != null) {
objectName.setText(object.getObjectName());
objectName.setImage(labelProvider.getImage(object));
} else {
// $NON-NLS-1$ //$NON-NLS-2$
objectName.setText("[" + objectId + "]");
}
}
}
}
use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.
the class UserConditionEditor method createContent.
/* (non-Javadoc)
* @see org.netxms.ui.eclipse.logviewer.widgets.ConditionEditor#createContent(org.eclipse.swt.widgets.Composite)
*/
@Override
protected void createContent(Composite parent, ColumnFilter initialFilter) {
Composite group = new Composite(this, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
layout.horizontalSpacing = WidgetHelper.INNER_SPACING;
layout.numColumns = 2;
group.setLayout(layout);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
group.setLayoutData(gd);
objectName = new CLabel(group, SWT.NONE);
toolkit.adapt(objectName);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.verticalAlignment = SWT.TOP;
objectName.setLayoutData(gd);
objectName.setText(EMPTY_SELECTION_TEXT);
final ImageHyperlink selectionLink = toolkit.createImageHyperlink(group, SWT.NONE);
selectionLink.setImage(SharedIcons.IMG_FIND);
selectionLink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
selectUser();
}
});
}
use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.
the class VPNSubnets method createNetworkList.
/**
* Creates network list
*
* @param dialogArea
* @param viewList viewer to be created and added to view
* @param data elements that should be added as a content of this viewer
*/
private void createNetworkList(Composite dialogArea, String title, TableViewer viewList, final List<InetAddressEx> data) {
Group clientArea = new Group(dialogArea, SWT.NONE);
clientArea.setText(title);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
GridData gd = new GridData();
clientArea.setLayout(layout);
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessVerticalSpace = true;
clientArea.setLayoutData(gd);
viewList = new TableViewer(clientArea, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessVerticalSpace = true;
gd.verticalSpan = 2;
gd.heightHint = 100;
viewList.getTable().setLayoutData(gd);
viewList.getTable().setSortDirection(SWT.UP);
viewList.setContentProvider(new ArrayContentProvider());
viewList.setComparator(new SubnetComparator());
viewList.setInput(data.toArray());
final TableViewer list = viewList;
final ImageHyperlink linkAdd = new ImageHyperlink(clientArea, SWT.NONE);
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) {
addTargetAddressListElement(list, data);
}
});
final ImageHyperlink linkRemove = new ImageHyperlink(clientArea, SWT.NONE);
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) {
removeTargetAddressListElements(list, data);
}
});
}
use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.
the class ReportExecutionForm method createResultsSection.
/**
* Create "Results" section's content
*
* @param parent
* parent composite
*/
private void createResultsSection(Composite parent) {
GridLayout layout = new GridLayout();
parent.setLayout(layout);
final String[] names = { "Execution Time", "Started by", "Status" };
final int[] widths = { 180, 140, 100 };
resultList = new SortableTableViewer(parent, names, widths, 0, SWT.DOWN, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;
resultList.getControl().setLayoutData(gd);
resultList.setContentProvider(new ArrayContentProvider());
resultList.setLabelProvider(new ReportResultLabelProvider());
WidgetHelper.restoreTableViewerSettings(resultList, Activator.getDefault().getDialogSettings(), "ReportExecutionForm.ResultList");
resultList.getControl().addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
WidgetHelper.saveTableViewerSettings(resultList, Activator.getDefault().getDialogSettings(), "ReportExecutionForm.ResultList");
}
});
ImageHyperlink link = toolkit.createImageHyperlink(parent, SWT.WRAP);
link.setImage(SharedIcons.IMG_EXECUTE);
link.setText("Execute Report");
link.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
executeReport();
}
});
createResultsContextMenu();
resultList.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection selection = (IStructuredSelection) resultList.getSelection();
actionDeleteResult.setEnabled(selection.size() > 0);
actionRenderPDF.setEnabled(selection.size() == 1);
actionRenderXLS.setEnabled(selection.size() == 1);
}
});
}
Aggregations