Search in sources :

Example 36 with ImageHyperlink

use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.

the class ExportFileBuilder method createSummaryTablesSection.

/**
 * Create "Summary Tables" section
 */
private void createSummaryTablesSection() {
    Section section = toolkit.createSection(form.getBody(), Section.TITLE_BAR);
    section.setText("DCI Summary Tables");
    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);
    summaryTableViewer = 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;
    summaryTableViewer.getTable().setLayoutData(gd);
    summaryTableViewer.setContentProvider(new ArrayContentProvider());
    summaryTableViewer.setLabelProvider(new SummaryTablesLabelProvider());
    summaryTableViewer.setComparator(new SummaryTablesComparator());
    summaryTableViewer.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) {
            addSummaryTables();
        }
    });
    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(summaryTableViewer, summaryTables);
        }
    });
}
Also used : HyperlinkEvent(org.eclipse.ui.forms.events.HyperlinkEvent) Composite(org.eclipse.swt.widgets.Composite) SummaryTablesComparator(org.netxms.ui.eclipse.serverconfig.views.helpers.SummaryTablesComparator) ImageHyperlink(org.eclipse.ui.forms.widgets.ImageHyperlink) Section(org.eclipse.ui.forms.widgets.Section) TableWrapData(org.eclipse.ui.forms.widgets.TableWrapData) GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) SummaryTablesLabelProvider(org.netxms.ui.eclipse.serverconfig.views.helpers.SummaryTablesLabelProvider) TableViewer(org.eclipse.jface.viewers.TableViewer) HyperlinkAdapter(org.eclipse.ui.forms.events.HyperlinkAdapter)

Example 37 with ImageHyperlink

use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.

the class ExportFileBuilder method createTemplateSection.

/**
 * Create "Templates" section
 */
private void createTemplateSection() {
    Section section = toolkit.createSection(form.getBody(), Section.TITLE_BAR);
    section.setText(Messages.get().ExportFileBuilder_SectionTemplates);
    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);
    templateViewer = new TableViewer(clientArea, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
    toolkit.adapt(templateViewer.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;
    templateViewer.getTable().setLayoutData(gd);
    templateViewer.setContentProvider(new ArrayContentProvider());
    templateViewer.setLabelProvider(new WorkbenchLabelProvider());
    templateViewer.setComparator(new ObjectLabelComparator((ILabelProvider) templateViewer.getLabelProvider()));
    templateViewer.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) {
            addTemplates();
        }
    });
    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(templateViewer, templates);
        }
    });
}
Also used : WorkbenchLabelProvider(org.eclipse.ui.model.WorkbenchLabelProvider) HyperlinkEvent(org.eclipse.ui.forms.events.HyperlinkEvent) Composite(org.eclipse.swt.widgets.Composite) ImageHyperlink(org.eclipse.ui.forms.widgets.ImageHyperlink) ObjectLabelComparator(org.netxms.ui.eclipse.tools.ObjectLabelComparator) ILabelProvider(org.eclipse.jface.viewers.ILabelProvider) Section(org.eclipse.ui.forms.widgets.Section) TableWrapData(org.eclipse.ui.forms.widgets.TableWrapData) GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) TableViewer(org.eclipse.jface.viewers.TableViewer) HyperlinkAdapter(org.eclipse.ui.forms.events.HyperlinkAdapter)

Example 38 with ImageHyperlink

use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.

the class SnmpCredentials method createSnmpPortList.

/**
 * Create "Port List" section
 */
private void createSnmpPortList() {
    Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION | Section.TITLE_BAR);
    section.setText("SNMP Ports");
    section.setDescription("SNMP ports used in the network");
    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);
    snmpPortList = new TableViewer(clientArea, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
    toolkit.adapt(snmpPortList.getTable());
    GridData gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.verticalAlignment = SWT.FILL;
    gd.grabExcessVerticalSpace = true;
    gd.verticalSpan = 2;
    gd.heightHint = 150;
    snmpPortList.getTable().setLayoutData(gd);
    snmpPortList.setContentProvider(new ArrayContentProvider());
    snmpPortList.setComparator(new StringComparator());
    final ImageHyperlink linkAdd = toolkit.createImageHyperlink(clientArea, SWT.NONE);
    linkAdd.setText(Messages.get().SnmpConfigurator_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) {
            addSnmpPort();
        }
    });
    final ImageHyperlink linkRemove = toolkit.createImageHyperlink(clientArea, SWT.NONE);
    linkRemove.setText(Messages.get().SnmpConfigurator_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) {
            removeSnmpPort();
        }
    });
}
Also used : TableWrapData(org.eclipse.ui.forms.widgets.TableWrapData) GridLayout(org.eclipse.swt.layout.GridLayout) HyperlinkEvent(org.eclipse.ui.forms.events.HyperlinkEvent) Composite(org.eclipse.swt.widgets.Composite) ImageHyperlink(org.eclipse.ui.forms.widgets.ImageHyperlink) GridData(org.eclipse.swt.layout.GridData) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) Section(org.eclipse.ui.forms.widgets.Section) TableViewer(org.eclipse.jface.viewers.TableViewer) StringComparator(org.netxms.ui.eclipse.tools.StringComparator) HyperlinkAdapter(org.eclipse.ui.forms.events.HyperlinkAdapter)

Example 39 with ImageHyperlink

use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.

the class SnmpCredentials method createSnmpUsmCredSection.

/**
 * Create "Address Filters" section
 */
private void createSnmpUsmCredSection() {
    Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION | Section.TITLE_BAR);
    section.setText(Messages.get().SnmpConfigurator_SectionUSM);
    section.setDescription(Messages.get().SnmpConfigurator_SectionUSMDescr);
    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);
    snmpUsmCredList = new TableViewer(clientArea, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
    toolkit.adapt(snmpUsmCredList.getTable());
    GridData gd = new GridData();
    gd.horizontalAlignment = SWT.FILL;
    gd.grabExcessHorizontalSpace = true;
    gd.verticalAlignment = SWT.FILL;
    gd.grabExcessVerticalSpace = true;
    gd.verticalSpan = 2;
    gd.heightHint = 150;
    snmpUsmCredList.getTable().setLayoutData(gd);
    snmpUsmCredList.setContentProvider(new ArrayContentProvider());
    snmpUsmCredList.setLabelProvider(new SnmpUsmLabelProvider());
    snmpUsmCredList.setComparator(new SnmpUsmComparator());
    final ImageHyperlink linkAdd = toolkit.createImageHyperlink(clientArea, SWT.NONE);
    linkAdd.setText(Messages.get().SnmpConfigurator_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) {
            addUsmCredentials();
        }
    });
    final ImageHyperlink linkRemove = toolkit.createImageHyperlink(clientArea, SWT.NONE);
    linkRemove.setText(Messages.get().SnmpConfigurator_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) {
            removeUsmCredentials();
        }
    });
}
Also used : HyperlinkEvent(org.eclipse.ui.forms.events.HyperlinkEvent) Composite(org.eclipse.swt.widgets.Composite) ImageHyperlink(org.eclipse.ui.forms.widgets.ImageHyperlink) Section(org.eclipse.ui.forms.widgets.Section) SnmpUsmLabelProvider(org.netxms.ui.eclipse.snmp.views.helpers.SnmpUsmLabelProvider) TableWrapData(org.eclipse.ui.forms.widgets.TableWrapData) GridLayout(org.eclipse.swt.layout.GridLayout) GridData(org.eclipse.swt.layout.GridData) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) SnmpUsmComparator(org.netxms.ui.eclipse.snmp.views.helpers.SnmpUsmComparator) TableViewer(org.eclipse.jface.viewers.TableViewer) HyperlinkAdapter(org.eclipse.ui.forms.events.HyperlinkAdapter)

Example 40 with ImageHyperlink

use of org.eclipse.ui.forms.widgets.ImageHyperlink in project netxms by netxms.

the class NetworkDiscoveryConfigurator method createActiveDiscoverySection.

/**
 * Create "Active Discovery Targets" section
 */
private void createActiveDiscoverySection() {
    Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION | Section.TITLE_BAR);
    section.setText(Messages.get().NetworkDiscoveryConfigurator_SectionActiveDiscoveryTargets);
    section.setDescription(Messages.get().NetworkDiscoveryConfigurator_SectionActiveDiscoveryTargetsDescr);
    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);
    activeDiscoveryAddressList = new TableViewer(clientArea, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
    toolkit.adapt(activeDiscoveryAddressList.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;
    activeDiscoveryAddressList.getTable().setLayoutData(gd);
    activeDiscoveryAddressList.getTable().setSortDirection(SWT.UP);
    activeDiscoveryAddressList.setContentProvider(new ArrayContentProvider());
    activeDiscoveryAddressList.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) {
            addTargetAddressListElement();
        }
    });
    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) {
            removeTargetAddressListElements();
        }
    });
}
Also used : TableWrapData(org.eclipse.ui.forms.widgets.TableWrapData) GridLayout(org.eclipse.swt.layout.GridLayout) HyperlinkEvent(org.eclipse.ui.forms.events.HyperlinkEvent) Composite(org.eclipse.swt.widgets.Composite) ImageHyperlink(org.eclipse.ui.forms.widgets.ImageHyperlink) GridData(org.eclipse.swt.layout.GridData) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) Section(org.eclipse.ui.forms.widgets.Section) TableViewer(org.eclipse.jface.viewers.TableViewer) AddressListElementComparator(org.netxms.ui.eclipse.serverconfig.views.helpers.AddressListElementComparator) HyperlinkAdapter(org.eclipse.ui.forms.events.HyperlinkAdapter)

Aggregations

ImageHyperlink (org.eclipse.ui.forms.widgets.ImageHyperlink)50 HyperlinkEvent (org.eclipse.ui.forms.events.HyperlinkEvent)46 HyperlinkAdapter (org.eclipse.ui.forms.events.HyperlinkAdapter)45 GridLayout (org.eclipse.swt.layout.GridLayout)37 Composite (org.eclipse.swt.widgets.Composite)35 GridData (org.eclipse.swt.layout.GridData)34 ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)19 TableViewer (org.eclipse.jface.viewers.TableViewer)17 Section (org.eclipse.ui.forms.widgets.Section)16 TableWrapData (org.eclipse.ui.forms.widgets.TableWrapData)16 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)8 CLabel (org.eclipse.swt.custom.CLabel)7 List (java.util.List)5 Image (org.eclipse.swt.graphics.Image)5 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)4 Control (org.eclipse.swt.widgets.Control)4 Label (org.eclipse.swt.widgets.Label)4 ArrayList (java.util.ArrayList)3 ILabelProvider (org.eclipse.jface.viewers.ILabelProvider)3 DisposeEvent (org.eclipse.swt.events.DisposeEvent)3