gvsig-projects-pool / org.gvsig.online / trunk / org.gvsig.online / org.gvsig.online.app / org.gvsig.online.app.mainplugin / src / main / java / org / gvsig / online / app / mainplugin / preferencespages / OnlinePage.java @ 9515
History | View | Annotate | Download (5 KB)
1 |
/*
|
---|---|
2 |
* To change this license header, choose License Headers in Project Properties.
|
3 |
* To change this template file, choose Tools | Templates
|
4 |
* and open the template in the editor.
|
5 |
*/
|
6 |
package org.gvsig.online.app.mainplugin.preferencespages; |
7 |
|
8 |
import com.jgoodies.forms.layout.CellConstraints; |
9 |
import javax.swing.DefaultComboBoxModel; |
10 |
import javax.swing.ImageIcon; |
11 |
import javax.swing.JPanel; |
12 |
import org.gvsig.andami.IconThemeHelper; |
13 |
import org.gvsig.andami.preferences.IPreference; |
14 |
import org.gvsig.andami.preferences.StoreException; |
15 |
import org.gvsig.fmap.dal.swing.featuretype.FeatureTypePanel; |
16 |
import org.gvsig.online.swing.api.OnlineJRegisterWorkspace; |
17 |
import org.gvsig.online.swing.api.OnlineSwingLocator; |
18 |
import org.gvsig.online.swing.api.OnlineSwingManager; |
19 |
import org.gvsig.tools.ToolsLocator; |
20 |
import org.gvsig.tools.i18n.I18nManager; |
21 |
import org.gvsig.tools.swing.api.ListElement; |
22 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
23 |
import org.gvsig.tools.swing.api.ToolsSwingManager; |
24 |
import org.gvsig.tools.util.LabeledValue; |
25 |
import org.gvsig.tools.util.LabeledValueImpl; |
26 |
//import org.gvsig.vcsgis.swing.OnlineJRegisterWorkspace;
|
27 |
//import org.gvsig.vcsgis.swing.OnlineSwingLocator;
|
28 |
//import org.gvsig.vcsgis.swing.OnlineSwingManager;
|
29 |
|
30 |
/**
|
31 |
*
|
32 |
* @author jjdelcerro
|
33 |
*/
|
34 |
public class OnlinePage extends OnlinePageView implements IPreference { |
35 |
//
|
36 |
// The class OnlinePage can extend from AbstractPreferencePage, not JPanel,
|
37 |
// if recreate it from the GUI builder change te class declaration to:
|
38 |
// public abstract class OnlinePageView extends AbstractPreferencePage
|
39 |
|
40 |
private ImageIcon icon; |
41 |
public static String id = OnlinePage.class.getName(); |
42 |
|
43 |
public OnlinePage() {
|
44 |
setParentID("org.gvsig.coreplugin.preferences.general.GeneralPage");
|
45 |
icon = IconThemeHelper.getImageIcon("vcsgis-preferences");
|
46 |
initComponents(); |
47 |
} |
48 |
|
49 |
private void initComponents() { |
50 |
OnlineSwingManager swingManager = OnlineSwingLocator.getOnlineSwingManager(); |
51 |
|
52 |
this.translateAll();
|
53 |
|
54 |
OnlineJRegisterWorkspace workspacesPanel = swingManager.createRegisterWorkspacePanel(); |
55 |
CellConstraints cc = new CellConstraints();
|
56 |
this.gridWorkspaces.add(workspacesPanel.asJComponent(),cc.xy(1,1)); |
57 |
DefaultComboBoxModel<LabeledValue<Integer>> model = new DefaultComboBoxModel(); |
58 |
model.addElement(new LabeledValueImpl<>("Edit only metadata", FeatureTypePanel.MODE_EDIT_ONLY_METADATA)); |
59 |
model.addElement(new LabeledValueImpl<>("Edit all", FeatureTypePanel.MODE_EDIT_ALL)); |
60 |
model.addElement(new LabeledValueImpl<>("Show only", FeatureTypePanel.MODE_SHOW_ONLY)); |
61 |
|
62 |
this.cboRepositoryEntityFeatureTypeEditorMode.setModel(model);
|
63 |
|
64 |
} |
65 |
|
66 |
private void translateAll() { |
67 |
ToolsSwingManager manager = ToolsSwingLocator.getToolsSwingManager(); |
68 |
|
69 |
manager.translate(tabPreferences); |
70 |
manager.translate(chkCurrentDateAsEffectiveDateByDefaultInCommitPanel); |
71 |
manager.translate(chkEmptyEffectiveDateAllowedInCommitPanel); |
72 |
manager.translate(lblAdvanced); |
73 |
manager.translate(lblChangesPanel); |
74 |
manager.translate(lblRepositoryEntityFeatureTypeEditorMode); |
75 |
} |
76 |
|
77 |
@Override
|
78 |
public void storeValues() throws StoreException { |
79 |
OnlineSwingManager swingManager = OnlineSwingLocator.getOnlineSwingManager(); |
80 |
// swingManager.setEmptyEffectiveDateAllowed(this.chkEmptyEffectiveDateAllowedInCommitPanel.isSelected());
|
81 |
// swingManager.setCurrentDateAsEffectiveDateByDefault(this.chkCurrentDateAsEffectiveDateByDefaultInCommitPanel.isSelected());
|
82 |
// LabeledValue<Integer> selectedMode = (LabeledValue<Integer>)this.cboRepositoryEntityFeatureTypeEditorMode.getSelectedItem();
|
83 |
// if(selectedMode != null){
|
84 |
// swingManager.setRepositoryEntityFeatureTypeEditorMode(selectedMode.getValue());
|
85 |
//
|
86 |
// }
|
87 |
} |
88 |
|
89 |
@Override
|
90 |
public void setChangesApplied() { |
91 |
} |
92 |
|
93 |
@Override
|
94 |
public String getID() { |
95 |
return id;
|
96 |
} |
97 |
|
98 |
@Override
|
99 |
public String getTitle() { |
100 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
101 |
return i18nManager.getTranslation("_Online"); |
102 |
} |
103 |
|
104 |
@Override
|
105 |
public JPanel getPanel() { |
106 |
return this; |
107 |
} |
108 |
|
109 |
@Override
|
110 |
public void initializeValues() { |
111 |
OnlineSwingManager swingManager = OnlineSwingLocator.getOnlineSwingManager(); |
112 |
// this.chkEmptyEffectiveDateAllowedInCommitPanel.setSelected(swingManager.getEmptyEffectiveDateAllowed());
|
113 |
// this.chkCurrentDateAsEffectiveDateByDefaultInCommitPanel.setSelected(swingManager.getCurrentDateAsEffectiveDateByDefault());
|
114 |
// ListElement.setSelected(cboRepositoryEntityFeatureTypeEditorMode, swingManager.getRepositoryEntityFeatureTypeEditorMode());
|
115 |
} |
116 |
|
117 |
@Override
|
118 |
public void initializeDefaults() { |
119 |
} |
120 |
|
121 |
@Override
|
122 |
public ImageIcon getIcon() { |
123 |
return this.icon; |
124 |
} |
125 |
|
126 |
@Override
|
127 |
public boolean isValueChanged() { |
128 |
return true; |
129 |
} |
130 |
|
131 |
@Override
|
132 |
public boolean isResizeable() { |
133 |
return true; |
134 |
} |
135 |
} |