use of org.netxms.ui.eclipse.agentmanager.widgets.AgentConfigEditor in project netxms by netxms.
the class AgentConfigEditorView method createPartControl.
/* (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
@Override
public void createPartControl(Composite parent) {
parent.setLayout(new FillLayout());
editor = new AgentConfigEditor(parent, SWT.NONE, SWT.H_SCROLL | SWT.V_SCROLL);
editor.getTextWidget().addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
if (!dirty) {
modified = true;
dirty = true;
firePropertyChange(PROP_DIRTY);
actionSave.setEnabled(true);
}
}
});
createActions();
contributeToActionBars();
actionSave.setEnabled(false);
}
use of org.netxms.ui.eclipse.agentmanager.widgets.AgentConfigEditor in project netxms by netxms.
the class ConfigPolicyEditor method createPartControl.
/* (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
@Override
public void createPartControl(Composite parent) {
super.createPartControl(parent);
parent.setLayout(new FillLayout());
editor = new AgentConfigEditor(parent, SWT.NONE, SWT.H_SCROLL | SWT.V_SCROLL);
editor.getTextWidget().addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
setModified();
}
});
}
use of org.netxms.ui.eclipse.agentmanager.widgets.AgentConfigEditor in project netxms by netxms.
the class ServerStoredAgentConfigEditorView method createPartControl.
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
@Override
public void createPartControl(Composite parent) {
parent.setLayout(new FillLayout());
SashForm splitter = new SashForm(parent, SWT.HORIZONTAL);
splitter.setSashWidth(3);
Composite listContainer = new Composite(splitter, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
layout.numColumns = 2;
layout.horizontalSpacing = 0;
listContainer.setLayout(layout);
configList = new TableViewer(listContainer, SWT.FULL_SELECTION | SWT.SINGLE);
configList.setContentProvider(new ArrayContentProvider());
configList.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
onSelectionChange(event);
}
});
configList.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
new Label(listContainer, SWT.SEPARATOR | SWT.VERTICAL).setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, true));
/**
** editor section ***
*/
FormToolkit toolkit = new FormToolkit(getSite().getShell().getDisplay());
Composite formContainer = new Composite(splitter, SWT.NONE);
layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
layout.numColumns = 2;
layout.horizontalSpacing = 0;
formContainer.setLayout(layout);
new Label(formContainer, SWT.SEPARATOR | SWT.VERTICAL).setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, true));
form = toolkit.createScrolledForm(formContainer);
form.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
form.setText(Messages.get().ServerStoredAgentConfigEditorView_Noname);
layout = new GridLayout();
form.getBody().setLayout(layout);
GridData gridData = new GridData();
gridData.horizontalAlignment = SWT.FILL;
gridData.grabExcessHorizontalSpace = true;
form.getBody().setLayoutData(gridData);
splitter.setWeights(new int[] { 20, 80 });
Section section = toolkit.createSection(form.getBody(), Section.TITLE_BAR);
section.setText(Messages.get().ServerStoredAgentConfigEditorView_Name);
layout = new GridLayout();
section.setLayout(layout);
gridData = new GridData();
gridData.horizontalAlignment = SWT.FILL;
gridData.grabExcessHorizontalSpace = true;
section.setLayoutData(gridData);
/**
** Name ***
*/
nameField = new Text(section, SWT.BORDER);
section.setClient(nameField);
gridData = new GridData();
gridData.horizontalAlignment = SWT.FILL;
gridData.grabExcessHorizontalSpace = true;
nameField.setLayoutData(gridData);
nameField.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
onTextModify();
}
});
/**
** Filter ***
*/
section = toolkit.createSection(form.getBody(), Section.TITLE_BAR);
section.setText(Messages.get().ServerStoredAgentConfigEditorView_Filter);
section.setLayout(layout);
gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.verticalAlignment = SWT.FILL;
gridData.grabExcessVerticalSpace = true;
section.setLayoutData(gridData);
filterEditor = new ScriptEditor(section, SWT.BORDER, SWT.H_SCROLL | SWT.V_SCROLL, true, "Variables:\r\n\t$1\tIP address\r\n\t$2\tplatform name\r\n\t$3\tmajor agent version number\r\n\t$4\tminor agent version number\r\n\t$5\trelease number\r\n\r\nReturn value: true if this configuration should be sent to agent");
section.setClient(filterEditor);
filterEditor.getTextWidget().addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
onTextModify();
}
});
gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.verticalAlignment = SWT.FILL;
gridData.grabExcessVerticalSpace = true;
filterEditor.setLayoutData(gridData);
/**
** Config ***
*/
section = toolkit.createSection(form.getBody(), Section.TITLE_BAR);
section.setText(Messages.get().ServerStoredAgentConfigEditorView_ConfigFile);
gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.verticalAlignment = SWT.FILL;
gridData.grabExcessVerticalSpace = true;
section.setLayoutData(gridData);
configEditor = new AgentConfigEditor(section, SWT.BORDER, SWT.H_SCROLL | SWT.V_SCROLL, 0);
section.setClient(configEditor);
configEditor.getTextWidget().addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
onTextModify();
}
});
gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.verticalAlignment = SWT.FILL;
gridData.grabExcessVerticalSpace = true;
configEditor.setLayoutData(gridData);
createActions();
contributeToActionBars();
createPopupMenu();
actionSave.setEnabled(false);
getConfigList();
}
Aggregations