~veger/ganttproject/manual-import

« back to all changes in this revision

Viewing changes to ganttproject/src/net/sourceforge/ganttproject/gui/options/model/DefaultEnumerationOption.java

  • Committer: Maarten Bezemer
  • Date: 2012-01-22 12:20:00 UTC
  • Revision ID: maarten.bezemer@gmail.com-20120122122000-qwyec45rjx86wi7o
Updated till 2fe683a778c3 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
GanttProject is an opensource project management tool. License: GPL2
 
2
GanttProject is an opensource project management tool. License: GPL3
3
3
Copyright (C) 2011 Dmitry Barashev, GanttProject Team
4
4
 
5
5
This program is free software; you can redistribute it and/or
6
6
modify it under the terms of the GNU General Public License
7
 
as published by the Free Software Foundation; either version 2
 
7
as published by the Free Software Foundation; either version 3
8
8
of the License, or (at your option) any later version.
9
9
 
10
10
This program is distributed in the hope that it will be useful,
67
67
        return myStringValue_ObjectValue.get(value);
68
68
    }
69
69
 
 
70
    @Override
70
71
    public String[] getAvailableValues() {
71
72
        return myValues;
72
73
    }
73
74
 
 
75
    @Override
74
76
    public String getPersistentValue() {
75
77
        return getValue();
76
78
    }
77
79
 
 
80
    @Override
78
81
    public void loadPersistentValue(String value) {
79
82
        setValue(value);
80
83
    }
 
84
 
 
85
    public T getSelectedValue() {
 
86
        return stringToObject(getValue());
 
87
    }
 
88
    public void setSelectedValue(T value) {
 
89
        String stringValue = objectToString(value);
 
90
        if (myStringValue_ObjectValue.containsKey(stringValue)) {
 
91
            setValue(stringValue);
 
92
        }
 
93
    }
81
94
}
 
 
b'\\ No newline at end of file'