use of org.netxms.ui.eclipse.objectmanager.widgets.SensorCommon in project netxms by netxms.
the class SensorProperties method createContents.
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createContents(Composite parent) {
Composite dialogArea = new Composite(parent, SWT.NONE);
sensor = (Sensor) getElement().getAdapter(Sensor.class);
GridLayout layout = new GridLayout();
layout.verticalSpacing = WidgetHelper.DIALOG_SPACING;
layout.horizontalSpacing = WidgetHelper.DIALOG_SPACING;
layout.marginWidth = 0;
layout.marginHeight = 0;
dialogArea.setLayout(layout);
commonData = new SensorCommon(dialogArea, SWT.NONE, null, sensor.getMacAddress().toString(), sensor.getDeviceClass(), sensor.getVendor(), sensor.getSerialNumber(), sensor.getDeviceAddress(), sensor.getMetaType(), sensor.getDescription(), sensor.getProxyId(), sensor.getCommProtocol());
GridData gd = new GridData();
gd.verticalAlignment = SWT.TOP;
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
commonData.setLayoutData(gd);
return dialogArea;
}
use of org.netxms.ui.eclipse.objectmanager.widgets.SensorCommon in project netxms by netxms.
the class CreateSensorWizard method performFinish.
@Override
public boolean performFinish() {
cd.setName(first.getObjectName());
cd.setCommProtocol(first.getCommMethod());
SensorCommon commonData = first.getCommonData();
cd.setMacAddress(commonData.getMacAddress());
cd.setDeviceClass(commonData.getDeviceClass());
cd.setVendor(commonData.getVendor());
cd.setSerialNumber(commonData.getSerial());
cd.setMetaType(commonData.getMetaType());
cd.setDeviceAddress(commonData.getDeviceAddress());
cd.setDescription(commonData.getDescription());
cd.setSensorProxy(commonData.getProxyNode());
if (cd.getCommProtocol() == Sensor.COMM_LORAWAN)
cd.setXmlRegConfig(lora.getRegConfig());
if (cd.getCommProtocol() == Sensor.COMM_LORAWAN)
cd.setXmlConfig(lora.getConfig());
return true;
}
use of org.netxms.ui.eclipse.objectmanager.widgets.SensorCommon in project netxms by netxms.
the class SensorGeneralPage method createControl.
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
@Override
public void createControl(Composite parent) {
container = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.verticalSpacing = WidgetHelper.DIALOG_SPACING;
layout.horizontalSpacing = WidgetHelper.DIALOG_SPACING;
layout.marginWidth = 0;
layout.marginHeight = 0;
container.setLayout(layout);
textObjectName = new LabeledText(container, SWT.NONE);
textObjectName.setLabel(Messages.get().General_ObjectName);
textObjectName.setText("");
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
textObjectName.setLayoutData(gd);
textObjectName.getTextControl().addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
getWizard().getContainer().updateButtons();
}
});
comboCommMethod = (Combo) WidgetHelper.createLabeledCombo(container, SWT.BORDER | SWT.READ_ONLY, Messages.get().SensorWizard_General_CommMethod, WidgetHelper.DEFAULT_LAYOUT_DATA);
comboCommMethod.setItems(Sensor.COMM_METHOD);
comboCommMethod.select(0);
gd = new GridData();
gd.grabExcessHorizontalSpace = false;
comboCommMethod.setLayoutData(gd);
comboCommMethod.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
getWizard().getContainer().updateButtons();
}
});
commonData = new SensorCommon(container, SWT.NONE, getWizard());
gd = new GridData();
gd.verticalAlignment = SWT.TOP;
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
commonData.setLayoutData(gd);
setControl(container);
}
Aggregations