use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.
the class NetworkDiscoveryConfigurator method createSubnetFilterSection.
/**
* Create "Address Filters" section
*/
private void createSubnetFilterSection() {
Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION | Section.TITLE_BAR);
section.setText(Messages.get().NetworkDiscoveryConfigurator_SectionAddressFilters);
section.setDescription(Messages.get().NetworkDiscoveryConfigurator_SectionAddressFiltersDescr);
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);
filterAddressList = new TableViewer(clientArea, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
toolkit.adapt(filterAddressList.getTable());
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessVerticalSpace = true;
gd.verticalSpan = 2;
gd.heightHint = 100;
filterAddressList.getTable().setLayoutData(gd);
filterAddressList.getTable().setSortDirection(SWT.UP);
filterAddressList.setContentProvider(new ArrayContentProvider());
filterAddressList.setComparator(new AddressListElementComparator());
final ImageHyperlink linkAdd = toolkit.createImageHyperlink(clientArea, SWT.NONE);
linkAdd.setText(Messages.get().NetworkDiscoveryConfigurator_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) {
addAddressFilterElement();
}
});
final ImageHyperlink linkRemove = toolkit.createImageHyperlink(clientArea, SWT.NONE);
linkRemove.setText(Messages.get().NetworkDiscoveryConfigurator_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) {
removeAddressFilterElements();
}
});
}
use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.
the class ObjectFieldEditor method createContent.
/* (non-Javadoc)
* @see org.netxms.ui.eclipse.reporter.widgets.FieldEditor#createContent(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createContent(Composite parent) {
Composite content = toolkit.createComposite(parent, SWT.BORDER);
GridLayout layout = new GridLayout();
layout.numColumns = 3;
layout.horizontalSpacing = WidgetHelper.OUTER_SPACING;
layout.marginHeight = 0;
layout.marginWidth = 0;
content.setLayout(layout);
text = new CLabel(content, SWT.NONE);
toolkit.adapt(text);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.verticalAlignment = SWT.TOP;
text.setLayoutData(gd);
text.setText(EMPTY_SELECTION_TEXT);
final ImageHyperlink selectionLink = toolkit.createImageHyperlink(content, SWT.NONE);
selectionLink.setImage(SharedIcons.IMG_FIND);
selectionLink.setToolTipText(Messages.get().ObjectFieldEditor_SelectObject);
selectionLink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
selectObject();
}
});
final ImageHyperlink clearLink = toolkit.createImageHyperlink(content, SWT.NONE);
clearLink.setImage(SharedIcons.IMG_CLEAR);
clearLink.setToolTipText(Messages.get().ObjectFieldEditor_ClearSelection);
clearLink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
objectId = 0;
text.setText(EMPTY_SELECTION_TEXT);
text.setImage(null);
}
});
return content;
}
use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.
the class ReportExecutionForm method createSchedulesSection.
/**
* Create "Schedules" section's content
*
* @param parent
* parent composite
*/
/**
* @param section
* @return
*/
private void createSchedulesSection(Composite parent) {
GridLayout layout = new GridLayout();
parent.setLayout(layout);
final String[] names = { "Type", "Schedule", "Owner", "Comments" };
final int[] widths = { 100, 140, 100, 300 };
scheduleList = 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;
scheduleList.getControl().setLayoutData(gd);
scheduleList.setContentProvider(new ArrayContentProvider());
scheduleList.setLabelProvider(new ScheduleLabelProvider());
WidgetHelper.restoreTableViewerSettings(scheduleList, Activator.getDefault().getDialogSettings(), "ReportExecutionForm.ScheduleList");
scheduleList.getControl().addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
WidgetHelper.saveTableViewerSettings(scheduleList, Activator.getDefault().getDialogSettings(), "ReportExecutionForm.ScheduleList");
}
});
ImageHyperlink link = toolkit.createImageHyperlink(parent, SWT.WRAP);
// $NON-NLS-1$
link.setImage(imageCache.add(Activator.getImageDescriptor("icons/schedule.png")));
link.setText("Add Schedule");
link.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
addSchedule();
}
});
createSchedulesContextMenu();
scheduleList.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection selection = (IStructuredSelection) scheduleList.getSelection();
actionDeleteSchedule.setEnabled(selection.size() > 0);
}
});
}
use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.
the class ObjectListFieldEditor method createContent.
/* (non-Javadoc)
* @see org.netxms.ui.eclipse.reporter.widgets.FieldEditor#createContent(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createContent(Composite parent) {
Composite content = toolkit.createComposite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
layout.verticalSpacing = WidgetHelper.INNER_SPACING;
layout.marginHeight = 0;
layout.marginWidth = 0;
content.setLayout(layout);
viewer = new TableViewer(content, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
viewer.setContentProvider(new ArrayContentProvider());
viewer.setLabelProvider(new WorkbenchLabelProvider());
viewer.setInput(new Object[0]);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;
gd.verticalSpan = 2;
viewer.getControl().setLayoutData(gd);
ImageHyperlink link = toolkit.createImageHyperlink(content, SWT.NONE);
link.setImage(SharedIcons.IMG_ADD_OBJECT);
link.setText(Messages.get().ObjectListFieldEditor_Add);
link.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
addObjects();
}
});
gd = new GridData();
gd.verticalAlignment = SWT.TOP;
link.setLayoutData(gd);
link = toolkit.createImageHyperlink(content, SWT.NONE);
link.setImage(SharedIcons.IMG_DELETE_OBJECT);
link.setText(Messages.get().ObjectListFieldEditor_Delete);
link.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
deleteObjects();
}
});
gd = new GridData();
gd.verticalAlignment = SWT.TOP;
link.setLayoutData(gd);
return content;
}
use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.
the class UserFieldEditor method createContent.
/* (non-Javadoc)
* @see org.netxms.ui.eclipse.reporter.widgets.FieldEditor#createContent(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createContent(Composite parent) {
Composite content = toolkit.createComposite(parent, SWT.BORDER);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
layout.horizontalSpacing = WidgetHelper.INNER_SPACING;
layout.marginHeight = 0;
layout.marginWidth = 0;
content.setLayout(layout);
text = new CLabel(content, SWT.NONE);
toolkit.adapt(text);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.verticalAlignment = SWT.TOP;
text.setLayoutData(gd);
text.setText(EMPTY_SELECTION_TEXT);
final ImageHyperlink selectionLink = toolkit.createImageHyperlink(content, SWT.NONE);
selectionLink.setImage(SharedIcons.IMG_FIND);
selectionLink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
selectUser();
}
});
return content;
}
Aggregations