use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class SyslogMonitor method createContents.
@Override
protected Control createContents(Composite parent) {
config = (SyslogMonitorConfig) getElement().getAdapter(SyslogMonitorConfig.class);
Composite dialogArea = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
dialogArea.setLayout(layout);
objectSelector = new ObjectSelector(dialogArea, SWT.NONE, true);
objectSelector.setLabel("Root object");
objectSelector.setObjectClass(AbstractObject.class);
objectSelector.setObjectId(config.getObjectId());
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
objectSelector.setLayoutData(gd);
title = new LabeledText(dialogArea, SWT.NONE);
title.setLabel("Title");
title.setText(config.getTitle());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
title.setLayoutData(gd);
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class CreateFolderDialog method createDialogArea.
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createDialogArea(Composite parent) {
Composite dialogArea = (Composite) super.createDialogArea(parent);
GridLayout layout = new GridLayout();
layout.marginHeight = WidgetHelper.DIALOG_HEIGHT_MARGIN;
layout.marginWidth = WidgetHelper.DIALOG_WIDTH_MARGIN;
layout.verticalSpacing = WidgetHelper.DIALOG_SPACING;
dialogArea.setLayout(layout);
textNewDirectoryName = new LabeledText(dialogArea, SWT.NONE);
textNewDirectoryName.setLabel(Messages.get().CreateFolderDialog_Label);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
textNewDirectoryName.setLayoutData(gd);
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class StartClientToServerFileUploadDialog method createDialogArea.
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createDialogArea(Composite parent) {
Composite dialogArea = (Composite) super.createDialogArea(parent);
GridLayout layout = new GridLayout();
layout.marginHeight = WidgetHelper.DIALOG_HEIGHT_MARGIN;
layout.marginWidth = WidgetHelper.DIALOG_WIDTH_MARGIN;
layout.verticalSpacing = WidgetHelper.DIALOG_SPACING;
dialogArea.setLayout(layout);
fileSelector = new LocalFileSelector(dialogArea, SWT.NONE, false, SWT.OPEN | SWT.MULTI);
fileSelector.setLabel(Messages.get().StartClientToServerFileUploadDialog_LocalFile);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.widthHint = 400;
fileSelector.setLayoutData(gd);
fileSelector.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
localFiles = fileSelector.getFileList();
if (localFiles.size() > 1) {
textRemoteFile.setEditable(false);
} else {
textRemoteFile.setEditable(true);
}
}
});
textRemoteFile = new LabeledText(dialogArea, SWT.NONE);
textRemoteFile.setLabel(Messages.get().StartClientToServerFileUploadDialog_RemoteFileName);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
textRemoteFile.setLayoutData(gd);
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class StartServerToAgentFileUploadDialog method createDialogArea.
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createDialogArea(Composite parent) {
Composite dialogArea = (Composite) super.createDialogArea(parent);
GridLayout layout = new GridLayout();
layout.marginHeight = WidgetHelper.DIALOG_HEIGHT_MARGIN;
layout.marginWidth = WidgetHelper.DIALOG_WIDTH_MARGIN;
layout.verticalSpacing = WidgetHelper.DIALOG_SPACING;
dialogArea.setLayout(layout);
Label label = new Label(dialogArea, SWT.NONE);
label.setText(Messages.get().StartServerToAgentFileUploadDialog_ServerFile);
fileList = new TableViewer(dialogArea, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.widthHint = 400;
gd.heightHint = 150;
fileList.getControl().setLayoutData(gd);
fileList.setContentProvider(new ArrayContentProvider());
fileList.setLabelProvider(new LabelProvider() {
@Override
public String getText(Object element) {
return ((ServerFile) element).getName();
}
});
fileList.setComparator(new ViewerComparator() {
@Override
public int compare(Viewer viewer, Object e1, Object e2) {
return ((ServerFile) e1).getName().compareToIgnoreCase(((ServerFile) e2).getName());
}
});
fileList.setInput(serverFiles);
Composite buttonArea = new Composite(dialogArea, SWT.NONE);
layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
layout.numColumns = 2;
buttonArea.setLayout(layout);
gd = new GridData();
gd.horizontalAlignment = SWT.RIGHT;
buttonArea.setLayoutData(gd);
buttonAddFile = new Button(buttonArea, SWT.PUSH);
buttonAddFile.setText("&Add...");
gd = new GridData();
gd.widthHint = WidgetHelper.BUTTON_WIDTH_HINT;
buttonAddFile.setLayoutData(gd);
buttonAddFile.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
SelectServerFileDialog dlg = new SelectServerFileDialog(getShell(), true);
if (dlg.open() == Window.OK) {
for (ServerFile f : dlg.getSelectedFiles()) {
boolean found = false;
for (ServerFile sf : serverFiles) if (sf.getName().equals(f.getName())) {
found = true;
break;
}
if (!found)
serverFiles.add(f);
}
fileList.refresh();
}
}
});
buttonRemoveFile = new Button(buttonArea, SWT.PUSH);
buttonRemoveFile.setText("&Remove");
gd = new GridData();
gd.widthHint = WidgetHelper.BUTTON_WIDTH_HINT;
buttonRemoveFile.setLayoutData(gd);
buttonRemoveFile.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
IStructuredSelection selection = (IStructuredSelection) fileList.getSelection();
for (Object o : selection.toList()) serverFiles.remove(o);
fileList.refresh();
}
});
textRemoteFile = new LabeledText(dialogArea, SWT.NONE);
textRemoteFile.setLabel(Messages.get().StartServerToAgentFileUploadDialog_RemoteFileName);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
textRemoteFile.setLayoutData(gd);
checkJobOnHold = new Button(dialogArea, SWT.CHECK);
checkJobOnHold.setText(Messages.get().StartServerToAgentFileUploadDialog_CreateJobOnHold);
checkJobOnHold.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
checkIsSchedule.setEnabled(!checkJobOnHold.getSelection());
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
});
if (canScheduleFileUpload) {
checkIsSchedule = new Button(dialogArea, SWT.CHECK);
checkIsSchedule.setText(Messages.get().StartServerToAgentFileUploadDialog_ScheduleTask);
checkIsSchedule.addSelectionListener(new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
checkJobOnHold.setEnabled(!checkIsSchedule.getSelection());
scheduleSelector.setEnabled(checkIsSchedule.getSelection());
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
});
scheduleSelector = new ScheduleSelector(dialogArea, SWT.NONE);
scheduleSelector.setEnabled(false);
}
return dialogArea;
}
use of org.netxms.ui.eclipse.widgets.LabeledText in project netxms by netxms.
the class MapLinkGeneral method createContents.
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createContents(Composite parent) {
object = (LinkEditor) getElement().getAdapter(LinkEditor.class);
Composite dialogArea = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.numColumns = 2;
dialogArea.setLayout(layout);
name = new LabeledText(dialogArea, SWT.NONE);
name.setLabel(Messages.get().MapLinkGeneral_Name);
name.setText(object.getName());
GridData gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
name.setLayoutData(gd);
connector1 = new LabeledText(dialogArea, SWT.NONE);
connector1.setLabel(Messages.get().MapLinkGeneral_NameConn1);
connector1.setText(object.getConnectorName1());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
connector1.setLayoutData(gd);
connector2 = new LabeledText(dialogArea, SWT.NONE);
connector2.setLabel(Messages.get().MapLinkGeneral_NameConn2);
connector2.setText(object.getConnectorName2());
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
connector2.setLayoutData(gd);
final Group colorGroup = new Group(dialogArea, SWT.NONE);
colorGroup.setText(Messages.get().MapLinkGeneral_Color);
layout = new GridLayout();
colorGroup.setLayout(layout);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
colorGroup.setLayoutData(gd);
final SelectionListener listener = new SelectionListener() {
@Override
public void widgetSelected(SelectionEvent e) {
color.setEnabled(radioColorCustom.getSelection());
list.setEnabled(radioColorObject.getSelection());
add.setEnabled(radioColorObject.getSelection());
remove.setEnabled(radioColorObject.getSelection());
checkUseThresholds.setEnabled(radioColorObject.getSelection());
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
};
radioColorDefault = new Button(colorGroup, SWT.RADIO);
radioColorDefault.setText(Messages.get().MapLinkGeneral_DefColor);
radioColorDefault.setSelection((object.getColor() < 0) && (object.getStatusObject().size() == 0));
radioColorDefault.addSelectionListener(listener);
radioColorObject = new Button(colorGroup, SWT.RADIO);
radioColorObject.setText(Messages.get().MapLinkGeneral_BasedOnObjStatus);
radioColorObject.setSelection(object.getStatusObject().size() != 0);
radioColorObject.addSelectionListener(listener);
final Composite nodeSelectionGroup = new Composite(colorGroup, SWT.NONE);
layout = new GridLayout();
layout.numColumns = 2;
nodeSelectionGroup.setLayout(layout);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalSpan = 2;
nodeSelectionGroup.setLayoutData(gd);
list = new List(nodeSelectionGroup, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.verticalSpan = 2;
gd.verticalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
gd.horizontalIndent = 20;
list.setLayoutData(gd);
if (object.getStatusObject() != null) {
for (int i = 0; i < object.getStatusObject().size(); i++) {
final AbstractObject obj = ((NXCSession) ConsoleSharedData.getSession()).findObjectById(object.getStatusObject().get(i));
// $NON-NLS-1$ //$NON-NLS-2$
list.add((obj != null) ? obj.getObjectName() : ("<" + Long.toString(object.getStatusObject().get(i)) + ">"));
}
}
list.setEnabled(radioColorObject.getSelection());
add = new Button(nodeSelectionGroup, SWT.PUSH);
add.setText(Messages.get().MapLinkGeneral_Add);
gd = new GridData();
gd.widthHint = WidgetHelper.BUTTON_WIDTH_HINT;
gd.verticalAlignment = SWT.TOP;
add.setLayoutData(gd);
add.addSelectionListener(new SelectionListener() {
@Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
@Override
public void widgetSelected(SelectionEvent e) {
addObject();
}
});
add.setEnabled(radioColorObject.getSelection());
remove = new Button(nodeSelectionGroup, SWT.PUSH);
remove.setText(Messages.get().MapLinkGeneral_Delete);
gd.widthHint = WidgetHelper.BUTTON_WIDTH_HINT;
gd.verticalAlignment = SWT.TOP;
remove.setLayoutData(gd);
remove.addSelectionListener(new SelectionListener() {
@Override
public void widgetDefaultSelected(SelectionEvent e) {
widgetSelected(e);
}
@Override
public void widgetSelected(SelectionEvent e) {
removeObject();
}
});
remove.setEnabled(radioColorObject.getSelection());
checkUseThresholds = new Button(nodeSelectionGroup, SWT.CHECK);
checkUseThresholds.setText("Use active thresholds");
checkUseThresholds.setEnabled(radioColorObject.getSelection());
checkUseThresholds.setSelection(object.isUseActiveThresholds());
gd = new GridData();
gd.horizontalIndent = 17;
checkUseThresholds.setLayoutData(gd);
radioColorCustom = new Button(colorGroup, SWT.RADIO);
radioColorCustom.setText(Messages.get().MapLinkGeneral_CustomColor);
radioColorCustom.setSelection((object.getColor() >= 0) && (object.getStatusObject().size() == 0));
radioColorCustom.addSelectionListener(listener);
color = new ColorSelector(colorGroup);
if (radioColorCustom.getSelection())
color.setColorValue(ColorConverter.rgbFromInt(object.getColor()));
else
color.setEnabled(false);
gd = new GridData();
gd.horizontalIndent = 20;
color.getButton().setLayoutData(gd);
gd = new GridData();
gd.horizontalAlignment = SWT.FILL;
gd.grabExcessHorizontalSpace = true;
routingAlgorithm = WidgetHelper.createLabeledCombo(dialogArea, SWT.READ_ONLY, Messages.get().MapLinkGeneral_RoutingAlg, gd);
routingAlgorithm.add(Messages.get().MapLinkGeneral_MapDefault);
routingAlgorithm.add(Messages.get().MapLinkGeneral_Direct);
routingAlgorithm.add(Messages.get().MapLinkGeneral_Manhattan);
routingAlgorithm.add(Messages.get().MapLinkGeneral_BendPoints);
routingAlgorithm.select(object.getRoutingAlgorithm());
return dialogArea;
}
Aggregations