use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.
the class ExportFileBuilder method createEventSection.
/**
* Create "Events" section
*/
private void createEventSection() {
Section section = toolkit.createSection(form.getBody(), Section.TITLE_BAR);
section.setText(Messages.get().ExportFileBuilder_SectionEvents);
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);
eventViewer = new TableViewer(clientArea, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
toolkit.adapt(eventViewer.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;
eventViewer.getTable().setLayoutData(gd);
eventViewer.setContentProvider(new ArrayContentProvider());
eventViewer.setLabelProvider(new WorkbenchLabelProvider());
eventViewer.setComparator(new ObjectLabelComparator((ILabelProvider) eventViewer.getLabelProvider()));
eventViewer.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) {
addEvents();
}
});
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(eventViewer, events);
}
});
}
use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.
the class ExportFileBuilder method createToolsSection.
/**
* Create "Object Tools" section
*/
private void createToolsSection() {
Section section = toolkit.createSection(form.getBody(), Section.TITLE_BAR);
section.setText("Object Tools");
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);
toolsViewer = 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;
toolsViewer.getTable().setLayoutData(gd);
toolsViewer.setContentProvider(new ArrayContentProvider());
toolsViewer.setLabelProvider(new ToolLabelProvider());
toolsViewer.setComparator(new ToolComparator());
toolsViewer.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) {
addObjectTools();
}
});
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(toolsViewer, tools);
}
});
}
use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.
the class ExportFileBuilder method createActionsSection.
/**
* Create "Actions" section
*/
private void createActionsSection() {
Section section = toolkit.createSection(form.getBody(), Section.TITLE_BAR);
section.setText("Actions");
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);
actionViewer = 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;
actionViewer.getTable().setLayoutData(gd);
actionViewer.setContentProvider(new ArrayContentProvider());
actionViewer.setLabelProvider(new ActionLabelProvider());
actionViewer.setComparator(new ActionComparator());
actionViewer.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) {
addActions();
}
});
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(actionViewer, actions);
}
});
}
use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.
the class ExportFileBuilder method createTrapSection.
/**
* Create "SNMP Traps" section
*/
private void createTrapSection() {
Section section = toolkit.createSection(form.getBody(), Section.TITLE_BAR);
section.setText(Messages.get().ExportFileBuilder_SectionTraps);
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);
trapViewer = new TableViewer(clientArea, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
toolkit.adapt(trapViewer.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;
trapViewer.getTable().setLayoutData(gd);
trapViewer.setContentProvider(new ArrayContentProvider());
trapViewer.setLabelProvider(new TrapListLabelProvider());
trapViewer.setComparator(new ObjectLabelComparator((ILabelProvider) eventViewer.getLabelProvider()));
trapViewer.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) {
if (snmpTrapCache == null) {
new ConsoleJob(Messages.get().ExportFileBuilder_TrapsLoadJobName, ExportFileBuilder.this, Activator.PLUGIN_ID, null) {
@Override
protected void runInternal(IProgressMonitor monitor) throws Exception {
snmpTrapCache = session.getSnmpTrapsConfigurationSummary();
runInUIThread(new Runnable() {
@Override
public void run() {
addTraps();
}
});
}
@Override
protected String getErrorMessage() {
return Messages.get().ExportFileBuilder_TrapsLoadJobError;
}
}.start();
} else {
addTraps();
}
}
});
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(trapViewer, traps);
}
});
}
use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.
the class LogParserRuleEditor method fillControlBar.
/**
* Fill control bar
*
* @param parent
*/
private void fillControlBar(Composite parent) {
ImageHyperlink link = toolkit.createImageHyperlink(parent, SWT.NONE);
link.setImage(SharedIcons.IMG_UP);
link.setToolTipText(Messages.get().LogParserRuleEditor_MoveUp);
link.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
editor.moveRuleUp(rule);
}
});
link = toolkit.createImageHyperlink(parent, SWT.NONE);
link.setImage(SharedIcons.IMG_DOWN);
link.setToolTipText(Messages.get().LogParserRuleEditor_MoveDown);
link.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
editor.moveRuleDown(rule);
}
});
link = toolkit.createImageHyperlink(parent, SWT.NONE);
link.setImage(SharedIcons.IMG_DELETE_OBJECT);
link.setToolTipText(Messages.get().LogParserRuleEditor_DeleteRule);
link.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
editor.deleteRule(rule);
}
});
}
Aggregations