Package net.sourceforge.ganttproject.task

Examples of net.sourceforge.ganttproject.task.CustomColumn


                {
                  AttributesImpl attrs = new AttributesImpl();
                  CustomColumnsValues customValues = t.getCustomValues();
                  for (Iterator it = getCustomColumnStorage().getCustomColums().iterator();
                       it.hasNext();) {
                    CustomColumn nextColumn = (CustomColumn) it.next();
                    Object value = customValues.getValue(nextColumn.getName());
                    String valueAsString = value==null ? "" : value.toString();
                    addAttribute("id", nextColumn.getId(), attrs);
                    textElement("custom-field", attrs, valueAsString, handler);
                  }
                }
                endPrefixedElement("task", handler);
                return "";
View Full Code Here


        while (it.hasNext()) {
            CustomPropertiesStructure cps = (CustomPropertiesStructure) it
                    .next();
            Task task = taskManager.getTask(cps.taskID);
            CustomColumn cc = myColumnStorage.getCustomColumnByID(cps.taskPropertyID);
            String valueStr = cps.value;
            Object value = null;
            Class cla = cc.getType();

            if (valueStr!=null) {
              if (cla.equals(String.class))
                  value = valueStr.toString();
              else if (cla.equals(Boolean.class))
                  value = Boolean.valueOf(valueStr);
              else if (cla.equals(Integer.class))
                  value = Integer.valueOf(valueStr);
              else if (cla.equals(Double.class))
                  value = Double.valueOf(valueStr);
              else if (GregorianCalendar.class.isAssignableFrom(cla))
                  try {
                      value = new GanttCalendar(DateParser.parse(valueStr));
                  } catch (InvalidDateException e) {
                    if (!GPLogger.log(e)) {
                      e.printStackTrace(System.err);
                    }
                  }
            }
            try {
                // System.out.println(task.getName());
                task.getCustomValues().setValue(cc.getName(), value);
            } catch (CustomColumnsException e) {
              if (!GPLogger.log(e)) {
                e.printStackTrace(System.err);
              }
            }
View Full Code Here

        buttonAdd.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                myUIfacade.getUndoManager().undoableEdit("TaskPropertyNewColumn",
                        new Runnable() {
                            public void run() {
                                CustomColumn customColumn = new CustomColumn();
                                GanttDialogCustomColumn d = new GanttDialogCustomColumn(
                                    myUIfacade, customColumn);
                                d.setVisible(true);
                                if (d.isOk()) {
                                  myColumnManager.addNewCustomColumn(customColumn);
View Full Code Here

            this.dataVector = new Vector();

            Iterator it = customColumnsHandler.getCustomColums().iterator();
            while (it.hasNext()) {
                CustomColumn cc = (CustomColumn) it.next();
                Object[] o = { cc.getName(), cc.getType(), cc.getDefaultValue() };
                this.addRow(o);
            }
        }
View Full Code Here

            customColumnsHandler = cch;
            this.dataVector = new Vector();

            Iterator it = customColumnsHandler.getCustomColums().iterator();
            while (it.hasNext()) {
                CustomColumn cc = (CustomColumn) it.next();
                Object[] o = { cc.getName(), cc.getType(), cc.getDefaultValue() };
                this.addRow(o);
            }
        }
View Full Code Here

        }

        public Object getValueAt(int row, int col) {
            String colName = (String) ((Vector) this.dataVector.get(row))
                    .get(0);
            CustomColumn res = customColumnsHandler.getCustomColumn(colName);
            if (res != null) {
                switch (col) {
                case 0:
                    return res.getName();
                case 1: {
                    Class cl = res.getType();
                    if (cl.equals(String.class))
                        return language.getText("text");
                    if (GregorianCalendar.class.isAssignableFrom(cl))
                        return language.getText("date");
                    if (cl.equals(Boolean.class))
                        return language.getText("boolean");
                    if (cl.equals(Integer.class))
                        return language.getText("integer");
                    if (cl.equals(Double.class))
                        return language.getText("double");
                }
                case 2:
                    return res.getDefaultValue();
                }
            }
            return null;
        }
View Full Code Here

        jmiAddColumn.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                myUIfacade.getUndoManager()
                        .undoableEdit("PopUpNewColumn", new Runnable() {
                            public void run() {
                                CustomColumn customColumn = new CustomColumn();
                                GanttDialogCustomColumn d = new GanttDialogCustomColumn(
                                    myUIfacade, customColumn);
                                d.setVisible(true);
                                if (d.isOk()) {
                                  getProject().getTaskCustomColumnManager().addNewCustomColumn(customColumn);
View Full Code Here

     * future tasks. Several types are available for the custom columns (string,
     * date, integer, double, boolean). A default value is also set.
     */
    public void addNewCustomColumn(CustomColumn customColumn) {
        if (customColumn == null) {
            customColumn = new CustomColumn();
            GanttDialogCustomColumn d = new GanttDialogCustomColumn(myUIfacade, customColumn);
            d.setVisible(true);
        }

        if (customColumn.getName() != null) // if something has been entered
View Full Code Here

                createPopupMenu();
                Component c = (Component) e.getSource();
                //reorderPopuMenu();
                popupMenu.show(c, e.getX(), e.getY());
                clickPoint = e.getPoint();//popupMenu.getLocationOnScreen();
                CustomColumn cc = getProject().getCustomColumnsStorage().getCustomColumn(
                        getTable().getColumnName(
                                getTable().columnAtPoint(e.getPoint())));
                if (cc != null)
                    jmiDeleteColumn.setEnabled(true);
                else
View Full Code Here

        String name = atts.getValue("name");
        String id = atts.getValue("id");
        String type = atts.getValue("valuetype");

        if (atts.getValue("type").equals("custom")) {
            CustomColumn cc;
            String valueStr = atts.getValue("defaultvalue");
              CustomPropertyDefinition stubDefinition = CustomPropertyManager.PropertyTypeEncoder.decodeTypeAndDefaultValue(type, valueStr);
            cc = new CustomColumn(name, stubDefinition.getType(), stubDefinition.getDefaultValue());
            cc.setId(id);

            myColumnStorage.addCustomColumn(cc);
        }
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.ganttproject.task.CustomColumn

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.