use of org.eclipse.ui.forms.widgets.TableWrapData 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();
}
});
}
use of org.eclipse.ui.forms.widgets.TableWrapData 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();
}
});
}
use of org.eclipse.ui.forms.widgets.TableWrapData 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();
}
});
}
use of org.eclipse.ui.forms.widgets.TableWrapData 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.TableWrapData in project netxms by netxms.
the class NetworkDiscoveryConfigurator method createGeneralSection.
/**
* Create "General" section
*/
private void createGeneralSection() {
Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION | Section.TITLE_BAR);
section.setText(Messages.get().NetworkDiscoveryConfigurator_SectionGeneral);
section.setDescription(Messages.get().NetworkDiscoveryConfigurator_SectionGeneralDescr);
TableWrapData td = new TableWrapData();
td.align = TableWrapData.FILL;
td.grabHorizontal = true;
section.setLayoutData(td);
Composite clientArea = toolkit.createComposite(section);
GridLayout layout = new GridLayout();
clientArea.setLayout(layout);
section.setClient(clientArea);
final SelectionListener listener = new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
setModified();
if (radioDiscoveryOff.getSelection()) {
config.setEnabled(false);
} else {
config.setEnabled(true);
config.setActive(radioDiscoveryActive.getSelection());
}
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
};
radioDiscoveryOff = toolkit.createButton(clientArea, Messages.get().NetworkDiscoveryConfigurator_Disabled, SWT.RADIO);
radioDiscoveryOff.addSelectionListener(listener);
radioDiscoveryPassive = toolkit.createButton(clientArea, Messages.get().NetworkDiscoveryConfigurator_PassiveDiscovery, SWT.RADIO);
radioDiscoveryPassive.addSelectionListener(listener);
radioDiscoveryActive = toolkit.createButton(clientArea, Messages.get().NetworkDiscoveryConfigurator_ActiveDiscovery, SWT.RADIO);
radioDiscoveryActive.addSelectionListener(listener);
checkUseSnmpTraps = toolkit.createButton(clientArea, Messages.get().NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery, SWT.CHECK);
checkUseSnmpTraps.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
config.setUseSnmpTraps(checkUseSnmpTraps.getSelection());
setModified();
}
});
GridData gd = new GridData();
gd.verticalIndent = 10;
checkUseSnmpTraps.setLayoutData(gd);
checkUseSyslog = toolkit.createButton(clientArea, Messages.get().NetworkDiscoveryConfigurator_UseSyslogForDiscovery, SWT.CHECK);
checkUseSyslog.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
config.setUseSyslog(checkUseSyslog.getSelection());
setModified();
}
});
}
Aggregations