svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.downloader / org.gvsig.downloader.app / org.gvsig.downloader.app.mainplugin / src / main / java / org / gvsig / downloader / app / mainplugin / DownloaderAuthenticatePreferencesPage.java @ 47821
History | View | Annotate | Download (3.82 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or modify it under
|
7 |
* the terms of the GNU General Public License as published by the Free Software
|
8 |
* Foundation; either version 3 of the License, or (at your option) any later
|
9 |
* version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful, but WITHOUT
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
13 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
14 |
* details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License along with
|
17 |
* this program; if not, write to the Free Software Foundation, Inc., 51
|
18 |
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
19 |
*
|
20 |
* For any additional information, do not hesitate to contact us at info AT
|
21 |
* gvsig.com, or visit our website www.gvsig.com.
|
22 |
*/
|
23 |
package org.gvsig.downloader.app.mainplugin; |
24 |
|
25 |
import java.awt.BorderLayout; |
26 |
import java.awt.event.ItemEvent; |
27 |
import java.awt.event.ItemListener; |
28 |
import javax.swing.ImageIcon; |
29 |
import javax.swing.JPanel; |
30 |
import javax.swing.event.ChangeEvent; |
31 |
import javax.swing.event.ChangeListener; |
32 |
import org.gvsig.andami.IconThemeHelper; |
33 |
import org.gvsig.andami.preferences.AbstractPreferencePage; |
34 |
import org.gvsig.andami.preferences.IPreference; |
35 |
import org.gvsig.andami.preferences.StoreException; |
36 |
import org.gvsig.downloader.swing.DownloaderSwingLocator; |
37 |
import org.gvsig.downloader.swing.DownloaderSwingManager; |
38 |
import org.gvsig.tools.ToolsLocator; |
39 |
import org.gvsig.tools.i18n.I18nManager; |
40 |
|
41 |
/**
|
42 |
* DownloaderAuthenticated configuration page.
|
43 |
*
|
44 |
* Here the user can establish what settings wants to use by default regarding
|
45 |
* to the document View.
|
46 |
*
|
47 |
*/
|
48 |
public class DownloaderAuthenticatePreferencesPage extends AbstractPreferencePage implements ChangeListener, ItemListener, IPreference { |
49 |
|
50 |
private static final long serialVersionUID = 1204688910771374514L; |
51 |
|
52 |
public static String id = DownloaderAuthenticatePreferencesPage.class.getName(); |
53 |
|
54 |
private ImageIcon icon; |
55 |
|
56 |
private boolean hasChanges = false; |
57 |
|
58 |
/**
|
59 |
* Creates a new panel containing View preferences settings.
|
60 |
*
|
61 |
*/
|
62 |
public DownloaderAuthenticatePreferencesPage() {
|
63 |
super();
|
64 |
|
65 |
this.initComponents();
|
66 |
this.initializeValues();
|
67 |
} |
68 |
|
69 |
private void initComponents(){ |
70 |
DownloaderSwingManager downloaderSwingManager = DownloaderSwingLocator.getDownloaderSwingManager(); |
71 |
this.setLayout(new BorderLayout()); |
72 |
this.add(
|
73 |
downloaderSwingManager.createDownloaderConfigPanel().asJComponent(), |
74 |
BorderLayout.CENTER
|
75 |
); |
76 |
} |
77 |
|
78 |
|
79 |
@Override
|
80 |
public boolean isResizeable() { |
81 |
return true; |
82 |
} |
83 |
|
84 |
@Override
|
85 |
public void initializeValues() { |
86 |
} |
87 |
|
88 |
@Override
|
89 |
public void stateChanged(ChangeEvent e) { |
90 |
this.hasChanges = true; |
91 |
} |
92 |
|
93 |
@Override
|
94 |
public void itemStateChanged(ItemEvent e) { |
95 |
this.hasChanges = true; |
96 |
} |
97 |
|
98 |
@Override
|
99 |
public String getID() { |
100 |
return id;
|
101 |
} |
102 |
|
103 |
@Override
|
104 |
public String getTitle() { |
105 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
106 |
return i18nManager.getTranslation("_Download_manager"); |
107 |
} |
108 |
|
109 |
@Override
|
110 |
public JPanel getPanel() { |
111 |
return this; |
112 |
} |
113 |
|
114 |
@Override
|
115 |
public void storeValues() throws StoreException { |
116 |
} |
117 |
|
118 |
@Override
|
119 |
public void initializeDefaults() { |
120 |
} |
121 |
|
122 |
@Override
|
123 |
public ImageIcon getIcon() { |
124 |
if(icon == null){ |
125 |
icon = IconThemeHelper.getImageIcon("downloadmanager-preferences");
|
126 |
} |
127 |
return icon;
|
128 |
} |
129 |
|
130 |
@Override
|
131 |
public boolean isValueChanged() { |
132 |
return this.hasChanges; |
133 |
} |
134 |
|
135 |
@Override
|
136 |
public void setChangesApplied() { |
137 |
this.hasChanges = true; |
138 |
} |
139 |
|
140 |
} |