source: trunk/src/org/expeditee/setting/FrameSetting.java@ 1513

Last change on this file since 1513 was 1242, checked in by bln4, 5 years ago

Support for new regime in the form of new fields and conditional setting of all paths fields.

Settings are now able to generate their own representation. This allows for the user to explicitly inspect the default values.

When profiles are created, an optional parameter may now be provided. If not null, the new map parameter can contain default values for settings to apply to this profile. This allows for the creation of profiles to that have (for example), their username set to an explicit value. Multiuser mode uses this functionality for usernames and key values among other things.

Frames can now be asked were they are located on the file system. Furthermore, frame indirection is now a thing. Rather than containing data to display, an exp file can contain a line in the format of "REDIRECT:<path>" to go looking for that data. Frames are able to return both their logical (their exp file) and real (the file actually containing the data) paths.

Frames can now store data.

Further fixes to how edits from other users are loaded in.

File size: 1.4 KB
Line 
1/**
2 * FrameSetting.java
3 * Copyright (C) 2010 New Zealand Digital Library, http://expeditee.org
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19package org.expeditee.setting;
20
21import org.expeditee.gui.Frame;
22import org.expeditee.items.Text;
23
24public abstract class FrameSetting extends Setting {
25
26 public FrameSetting(String tooltip, String name) {
27 super(tooltip, name);
28 }
29
30 /**
31 * The code to run
32 * Must be overridden
33 */
34 protected abstract void run(Frame frame);
35
36 /**
37 * runs the setting specific code if the text item has a child frame
38 */
39 public boolean setSetting(Text text) {
40 if(text.getChild() != null) {
41 run(text.getChild());
42 return true;
43 }
44 return false;
45 }
46
47 @Override
48 public Text generateRepresentation(String label, String frameset) {
49 Text t = new Text(label);
50 return t;
51 }
52}
Note: See TracBrowser for help on using the repository browser.