report execution form improved
authorVictor Kirhenshtein <victor@netxms.org>
Mon, 15 Aug 2011 12:17:52 +0000 (12:17 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Mon, 15 Aug 2011 12:17:52 +0000 (12:17 +0000)
13 files changed:
.gitattributes
doc/internal/report_definition.docx [new file with mode: 0644]
src/flow_analyzer/nxflowd/nxflowd.cpp
src/java/netxms-eclipse/Reporter/icons/execute.gif [new file with mode: 0644]
src/java/netxms-eclipse/Reporter/icons/execute.png [deleted file]
src/java/netxms-eclipse/Reporter/icons/schedule.png [new file with mode: 0644]
src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/views/ReportView.java
src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/widgets/FieldEditor.java [new file with mode: 0644]
src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/widgets/ReportExecutionForm.java
src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/widgets/StringFieldEditor.java [new file with mode: 0644]
src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/widgets/TimestampFieldEditor.java [new file with mode: 0644]
src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/widgets/helpers/ReportDefinition.java
src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/widgets/helpers/ReportParameter.java

index a77220d..196ee00 100644 (file)
@@ -80,6 +80,7 @@ doc/internal/dci_perftab.txt -text
 doc/internal/netxms_architecture.gxml -text
 doc/internal/netxms_architecture.png -text
 doc/internal/netxms_architecture.svg -text
+doc/internal/report_definition.docx -text
 doc/manuals/client_library.doc -text
 doc/manuals/netxms_install_guide.odt -text
 doc/manuals/netxms_solution_guide.doc -text
@@ -1190,8 +1191,9 @@ src/java/netxms-eclipse/PolicyManager/src/org/netxms/ui/eclipse/policymanager/pr
 src/java/netxms-eclipse/Reporter/.settings/org.eclipse.jdt.core.prefs -text
 src/java/netxms-eclipse/Reporter/META-INF/MANIFEST.MF -text
 src/java/netxms-eclipse/Reporter/build.properties -text
-src/java/netxms-eclipse/Reporter/icons/execute.png -text
+src/java/netxms-eclipse/Reporter/icons/execute.gif -text
 src/java/netxms-eclipse/Reporter/icons/report.png -text
+src/java/netxms-eclipse/Reporter/icons/schedule.png -text
 src/java/netxms-eclipse/Reporter/plugin.xml -text
 src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/Activator.java -text
 src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/actions/CreateReport.java -text
@@ -1199,7 +1201,10 @@ src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/actions/Crea
 src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/actions/OpenReport.java -text
 src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/dialogs/CreateReportDialog.java -text
 src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/views/ReportView.java -text
+src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/widgets/FieldEditor.java -text
 src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/widgets/ReportExecutionForm.java -text
+src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/widgets/StringFieldEditor.java -text
+src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/widgets/TimestampFieldEditor.java -text
 src/java/netxms-eclipse/SNMP/.settings/org.eclipse.jdt.core.prefs -text
 src/java/netxms-eclipse/SNMP/META-INF/MANIFEST.MF -text
 src/java/netxms-eclipse/SNMP/build.properties -text
diff --git a/doc/internal/report_definition.docx b/doc/internal/report_definition.docx
new file mode 100644 (file)
index 0000000..b531252
Binary files /dev/null and b/doc/internal/report_definition.docx differ
index 9b8ebe9..ceda631 100644 (file)
@@ -55,6 +55,7 @@ static TCHAR s_dbDriver[MAX_PATH] = _T("");
 static TCHAR s_dbDrvParams[MAX_PATH] = _T("");
 static TCHAR s_dbServer[MAX_PATH] = _T("localhost");
 static TCHAR s_dbName[MAX_DB_NAME] = _T("netxms_db");
+static TCHAR s_dbSchema[MAX_DB_NAME] = _T("");
 static TCHAR s_dbLogin[MAX_DB_LOGIN] = _T("netxms");
 static TCHAR s_dbPassword[MAX_DB_PASSWORD] = _T("");
 static TCHAR s_encryptedDbPassword[MAX_DB_STRING] = _T("");
@@ -66,6 +67,7 @@ static NX_CFG_TEMPLATE m_cfgTemplate[] =
    { "DBLogin", CT_STRING, 0, 0, MAX_DB_LOGIN, 0, s_dbLogin },
    { "DBName", CT_STRING, 0, 0, MAX_DB_NAME, 0, s_dbName },
    { "DBPassword", CT_STRING, 0, 0, MAX_DB_PASSWORD, 0, s_dbPassword },
+   { "DBSchema", CT_STRING, 0, 0, MAX_DB_NAME, 0, s_dbSchema },
    { "DBServer", CT_STRING, 0, 0, MAX_PATH, 0, s_dbServer },
    { "ListenAddress", CT_STRING, 0, 0, MAX_PATH, 0, g_listenAddress },
    { "ListenPortTCP", CT_LONG, 0, 0, 0, 0, &g_tcpPort },
@@ -156,7 +158,7 @@ bool Initialize()
        TCHAR errorText[DBDRV_MAX_ERROR_TEXT];
        for(int i = 0; ; i++)
        {
-               g_dbConnection = DBConnect(g_dbDriverHandle, s_dbServer, s_dbName, s_dbLogin, s_dbPassword, errorText);
+               g_dbConnection = DBConnect(g_dbDriverHandle, s_dbServer, s_dbName, s_dbLogin, s_dbPassword, s_dbSchema, errorText);
                if ((g_dbConnection != NULL) || (i == 5))
                        break;
                ThreadSleep(5);
diff --git a/src/java/netxms-eclipse/Reporter/icons/execute.gif b/src/java/netxms-eclipse/Reporter/icons/execute.gif
new file mode 100644 (file)
index 0000000..57f4102
Binary files /dev/null and b/src/java/netxms-eclipse/Reporter/icons/execute.gif differ
diff --git a/src/java/netxms-eclipse/Reporter/icons/execute.png b/src/java/netxms-eclipse/Reporter/icons/execute.png
deleted file mode 100644 (file)
index f35a979..0000000
Binary files a/src/java/netxms-eclipse/Reporter/icons/execute.png and /dev/null differ
diff --git a/src/java/netxms-eclipse/Reporter/icons/schedule.png b/src/java/netxms-eclipse/Reporter/icons/schedule.png
new file mode 100644 (file)
index 0000000..75f2c63
Binary files /dev/null and b/src/java/netxms-eclipse/Reporter/icons/schedule.png differ
index 6e56aa0..1d03d0e 100644 (file)
@@ -27,7 +27,6 @@ import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.part.ViewPart;\r
 import org.netxms.client.NXCSession;\r
 import org.netxms.client.objects.GenericObject;\r
-import org.netxms.client.objects.Node;\r
 import org.netxms.client.objects.Report;\r
 import org.netxms.ui.eclipse.reporter.widgets.ReportExecutionForm;\r
 import org.netxms.ui.eclipse.shared.ConsoleSharedData;\r
diff --git a/src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/widgets/FieldEditor.java b/src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/widgets/FieldEditor.java
new file mode 100644 (file)
index 0000000..f041f5d
--- /dev/null
@@ -0,0 +1,81 @@
+/**\r
+ * NetXMS - open source network management system\r
+ * Copyright (C) 2003-2011 Victor Kirhenshtein\r
+ *\r
+ * This program is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+ */\r
+package org.netxms.ui.eclipse.reporter.widgets;\r
+\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.layout.GridData;\r
+import org.eclipse.swt.layout.GridLayout;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.Label;\r
+import org.eclipse.ui.forms.widgets.FormToolkit;\r
+import org.netxms.ui.eclipse.reporter.widgets.helpers.ReportParameter;\r
+import org.netxms.ui.eclipse.tools.WidgetHelper;\r
+\r
+\r
+/**\r
+ * Abstract field editor for report\r
+ */\r
+public abstract class FieldEditor extends Composite\r
+{\r
+       protected ReportParameter parameter;\r
+       protected FormToolkit toolkit;\r
+\r
+       private Label label;\r
+       \r
+       /**\r
+        * @param parameter\r
+        * @param toolkit\r
+        * @param parent\r
+        */\r
+       public FieldEditor(ReportParameter parameter, FormToolkit toolkit, Composite parent)\r
+       {\r
+               super(parent, SWT.NONE);\r
+               this.parameter = parameter;\r
+               this.toolkit = toolkit;\r
+\r
+               GridLayout layout = new GridLayout();\r
+               layout.verticalSpacing = WidgetHelper.INNER_SPACING;\r
+               layout.marginTop = 0;\r
+               layout.marginBottom = 0;\r
+               layout.marginWidth = 0;\r
+               layout.marginHeight = 0;\r
+               setLayout(layout);\r
+               \r
+               label = toolkit.createLabel(this, parameter.getDisplayName());\r
+               GridData gd = new GridData();\r
+               gd.horizontalAlignment = SWT.FILL;\r
+               label.setLayoutData(gd);\r
+               \r
+               createContent(this);\r
+       }\r
+       \r
+       /**\r
+        * Create editor's content.\r
+        * \r
+        * @param parent parent composite\r
+        */\r
+       abstract protected void createContent(Composite parent);\r
+       \r
+       /**\r
+        * Get current value for parameter being edited.\r
+        * \r
+        * @return current value for parameter\r
+        */\r
+       abstract public String getValue();\r
+}\r
index e8e3ecb..2a77ca1 100644 (file)
@@ -22,17 +22,11 @@ import java.util.ArrayList;
 import java.util.HashMap;\r
 import java.util.List;\r
 import java.util.Map;\r
-import java.util.Map.Entry;\r
-\r
 import org.eclipse.core.runtime.IProgressMonitor;\r
 import org.eclipse.jface.dialogs.MessageDialog;\r
 import org.eclipse.swt.SWT;\r
 import org.eclipse.swt.layout.FillLayout;\r
-import org.eclipse.swt.layout.GridLayout;\r
 import org.eclipse.swt.widgets.Composite;\r
-import org.eclipse.swt.widgets.Control;\r
-import org.eclipse.swt.widgets.Text;\r
-import org.eclipse.ui.IWorkbenchPage;\r
 import org.eclipse.ui.IWorkbenchPart;\r
 import org.eclipse.ui.forms.events.HyperlinkAdapter;\r
 import org.eclipse.ui.forms.events.HyperlinkEvent;\r
@@ -59,7 +53,7 @@ public class ReportExecutionForm extends Composite
        private Report report;\r
        private FormToolkit toolkit;\r
        private ScrolledForm form;\r
-       private List<Control> fields = new ArrayList<Control>();\r
+       private List<FieldEditor> fields = new ArrayList<FieldEditor>();\r
        private List<ReportParameter> parameters;\r
        \r
        /**\r
@@ -85,7 +79,7 @@ public class ReportExecutionForm extends Composite
                \r
                Section section = toolkit.createSection(form.getBody(), Section.DESCRIPTION | Section.TITLE_BAR);\r
                section.setText("Parameters");\r
-               section.setDescription("Please provide parameters necessary to run this report in fields below");\r
+               section.setDescription("Provide parameters necessary to run this report in fields below");\r
                TableWrapData td = new TableWrapData();\r
                td.align = TableWrapData.FILL;\r
                td.grabHorizontal = true;\r
@@ -100,6 +94,7 @@ public class ReportExecutionForm extends Composite
                \r
                section = toolkit.createSection(form.getBody(), Section.DESCRIPTION | Section.TITLE_BAR);\r
                section.setText("Actions");\r
+               section.setDescription("Select desired action from the list below");\r
                td = new TableWrapData();\r
                td.align = TableWrapData.FILL;\r
                td.grabHorizontal = true;\r
@@ -111,7 +106,7 @@ public class ReportExecutionForm extends Composite
                section.setClient(actionArea);\r
                \r
                ImageHyperlink link = toolkit.createImageHyperlink(actionArea, SWT.WRAP);\r
-               link.setImage(Activator.getImageDescriptor("icons/execute.png").createImage());\r
+               link.setImage(Activator.getImageDescriptor("icons/execute.gif").createImage());\r
                link.setText("Execute report");\r
                link.addHyperlinkListener(new HyperlinkAdapter() {\r
                        @Override\r
@@ -120,6 +115,16 @@ public class ReportExecutionForm extends Composite
                                executeReport();\r
                        }\r
                });\r
+               \r
+               link = toolkit.createImageHyperlink(actionArea, SWT.WRAP);\r
+               link.setImage(Activator.getImageDescriptor("icons/schedule.png").createImage());\r
+               link.setText("Schedule report execution");\r
+               link.addHyperlinkListener(new HyperlinkAdapter() {\r
+                       @Override\r
+                       public void linkActivated(HyperlinkEvent e)\r
+                       {\r
+                       }\r
+               });\r
        }\r
 \r
        /**\r
@@ -135,23 +140,26 @@ public class ReportExecutionForm extends Composite
                        parameters = definition.getParameters();\r
                        for(ReportParameter p : parameters)\r
                        {\r
-                               toolkit.createLabel(parent, p.getDisplayName());\r
-                               Control control;\r
+                               FieldEditor editor;\r
                                switch(p.getDataType())\r
                                {\r
                                        case ReportParameter.INTEGER:\r
-                                               control = toolkit.createText(parent, p.getDefaultValue());\r
+                                               editor = new StringFieldEditor(p, toolkit, parent);\r
+                                               break;\r
+                                       case ReportParameter.TIMESTAMP:\r
+                                               editor = new TimestampFieldEditor(p, toolkit, parent);\r
                                                break;\r
                                        default:                // everything else as string\r
-                                               control = toolkit.createText(parent, p.getDefaultValue());\r
+                                               editor = new StringFieldEditor(p, toolkit, parent);\r
                                                break;\r
                                }\r
                                \r
                                TableWrapData td = new TableWrapData();\r
                                td.align = TableWrapData.FILL;\r
                                td.grabHorizontal = true;\r
-                               control.setLayoutData(td);\r
-                               fields.add(control);\r
+                               td.colspan = p.getColumnSpan();\r
+                               editor.setLayoutData(td);\r
+                               fields.add(editor);\r
                        }\r
                }\r
                catch(Exception e)\r
@@ -169,7 +177,7 @@ public class ReportExecutionForm extends Composite
                final Map<String, String> execParameters = new HashMap<String, String>(parameters.size());\r
                for(int i = 0; i < parameters.size(); i++)\r
                {\r
-                       execParameters.put(parameters.get(i).getName(), ((Text)fields.get(i)).getText());\r
+                       execParameters.put(parameters.get(i).getName(), fields.get(i).getValue());\r
                }\r
                \r
                new ConsoleJob("Execute report", workbenchPart, Activator.PLUGIN_ID, null) {\r
diff --git a/src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/widgets/StringFieldEditor.java b/src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/widgets/StringFieldEditor.java
new file mode 100644 (file)
index 0000000..6bb482f
--- /dev/null
@@ -0,0 +1,68 @@
+/**\r
+ * NetXMS - open source network management system\r
+ * Copyright (C) 2003-2011 Victor Kirhenshtein\r
+ *\r
+ * This program is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+ */\r
+package org.netxms.ui.eclipse.reporter.widgets;\r
+\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.layout.GridData;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.Text;\r
+import org.eclipse.ui.forms.widgets.FormToolkit;\r
+import org.netxms.ui.eclipse.reporter.widgets.helpers.ReportParameter;\r
+\r
+/**\r
+ * Editor for string fields\r
+ *\r
+ */\r
+public class StringFieldEditor extends FieldEditor\r
+{\r
+       private Text text;\r
+       \r
+       /**\r
+        * @param parameter\r
+        * @param toolkit\r
+        * @param parent\r
+        */\r
+       public StringFieldEditor(ReportParameter parameter, FormToolkit toolkit, Composite parent)\r
+       {\r
+               super(parameter, toolkit, parent);\r
+       }\r
+\r
+       /* (non-Javadoc)\r
+        * @see org.netxms.ui.eclipse.reporter.widgets.FieldEditor#createContent(org.eclipse.swt.widgets.Composite)\r
+        */\r
+       @Override\r
+       protected void createContent(Composite parent)\r
+       {\r
+               text = toolkit.createText(this, parameter.getDefaultValue());\r
+               GridData gd = new GridData();\r
+               gd.horizontalAlignment = SWT.FILL;\r
+               gd.grabExcessHorizontalSpace = true;\r
+               gd.verticalAlignment = SWT.TOP;\r
+               text.setLayoutData(gd);\r
+       }\r
+\r
+       /* (non-Javadoc)\r
+        * @see org.netxms.ui.eclipse.reporter.widgets.FieldEditor#getValue()\r
+        */\r
+       @Override\r
+       public String getValue()\r
+       {\r
+               return text.getText();\r
+       }\r
+}\r
diff --git a/src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/widgets/TimestampFieldEditor.java b/src/java/netxms-eclipse/Reporter/src/org/netxms/ui/eclipse/reporter/widgets/TimestampFieldEditor.java
new file mode 100644 (file)
index 0000000..3511b16
--- /dev/null
@@ -0,0 +1,95 @@
+/**\r
+ * NetXMS - open source network management system\r
+ * Copyright (C) 2003-2011 Victor Kirhenshtein\r
+ *\r
+ * This program is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+ */\r
+package org.netxms.ui.eclipse.reporter.widgets;\r
+\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.layout.GridLayout;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.swt.widgets.DateTime;\r
+import org.eclipse.ui.forms.widgets.FormToolkit;\r
+import org.netxms.ui.eclipse.reporter.widgets.helpers.ReportParameter;\r
+import org.netxms.ui.eclipse.tools.WidgetHelper;\r
+\r
+/**\r
+ * Editor for timestamp parameters\r
+ */\r
+public class TimestampFieldEditor extends FieldEditor\r
+{\r
+       private DateTime datePicker;\r
+       private DateTime timePicker;\r
+       \r
+       /**\r
+        * @param parameter\r
+        * @param toolkit\r
+        * @param parent\r
+        */\r
+       public TimestampFieldEditor(ReportParameter parameter, FormToolkit toolkit, Composite parent)\r
+       {\r
+               super(parameter, toolkit, parent);\r
+       }\r
+\r
+       /* (non-Javadoc)\r
+        * @see org.netxms.ui.eclipse.reporter.widgets.FieldEditor#createContent(org.eclipse.swt.widgets.Composite)\r
+        */\r
+       @Override\r
+       protected void createContent(Composite parent)\r
+       {\r
+               final Composite area = new Composite(parent, SWT.NONE);\r
+               GridLayout layout = new GridLayout();\r
+               layout.numColumns = 2;\r
+               layout.marginHeight = 0;\r
+               layout.marginWidth = 0;\r
+               layout.horizontalSpacing = WidgetHelper.INNER_SPACING;\r
+               area.setLayout(layout);\r
+               \r
+               Date date;\r
+               try\r
+               {\r
+                       date = new Date(Long.parseLong(parameter.getDefaultValue()) * 1000);\r
+               }\r
+               catch(NumberFormatException e)\r
+               {\r
+                       date = new Date();\r
+               }\r
+               \r
+               final Calendar c = Calendar.getInstance();\r
+               c.setTime(date);\r
+               \r
+               datePicker = new DateTime(area, SWT.DATE | SWT.DROP_DOWN);\r
+               datePicker.setDate(c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH));\r
+\r
+               timePicker = new DateTime(area, SWT.TIME);\r
+               timePicker.setTime(c.get(Calendar.HOUR_OF_DAY), c.get(Calendar.MINUTE), c.get(Calendar.SECOND));\r
+       }\r
+\r
+       /* (non-Javadoc)\r
+        * @see org.netxms.ui.eclipse.reporter.widgets.FieldEditor#getValue()\r
+        */\r
+       @Override\r
+       public String getValue()\r
+       {\r
+               final Calendar c = Calendar.getInstance();\r
+               c.clear();\r
+               c.set(datePicker.getYear(), datePicker.getMonth(), datePicker.getDay(),\r
+                               timePicker.getHours(), timePicker.getMinutes(), timePicker.getSeconds());\r
+               return Long.toString(c.getTimeInMillis() / 1000);\r
+       }\r
+}\r
index b3cffc0..27bbbfa 100644 (file)
@@ -1,5 +1,20 @@
 /**
- * 
+ * NetXMS - open source network management system
+ * Copyright (C) 2003-2011 Victor Kirhenshtein
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 package org.netxms.ui.eclipse.reporter.widgets.helpers;
 
index 1ca5d0e..1095b74 100644 (file)
@@ -1,5 +1,20 @@
 /**
- * 
+ * NetXMS - open source network management system
+ * Copyright (C) 2003-2011 Victor Kirhenshtein
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 package org.netxms.ui.eclipse.reporter.widgets.helpers;
 
@@ -77,6 +92,17 @@ public class ReportParameter
        }
 
        /**
+        * Get column span for parameter
+        * 
+        * @return
+        */
+       public int getColumnSpan()
+       {
+               String value = properties.get("netxms.layout.columnSpan");
+               return (value != null) ? Integer.parseInt(value) : 1;
+       }
+
+       /**
         * @return the description
         */
        public String getDescription()