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 / DownloaderExtension.java @ 47821
History | View | Annotate | Download (2.39 KB)
1 | 47821 | jjdelcerro | /**
|
---|---|---|---|
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
|
||
7 | * modify it under the terms of the GNU General Public License
|
||
8 | * as published by the Free Software Foundation; either version 3
|
||
9 | * of the License, or (at your option) any later version.
|
||
10 | *
|
||
11 | * This program is distributed in the hope that it will be useful,
|
||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
14 | * GNU General Public License for more details.
|
||
15 | *
|
||
16 | * You should have received a copy of the GNU General Public License
|
||
17 | * along with this program; if not, write to the Free Software
|
||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||
19 | * MA 02110-1301, USA.
|
||
20 | *
|
||
21 | * For any additional information, do not hesitate to contact us
|
||
22 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
23 | */
|
||
24 | package org.gvsig.downloader.app.mainplugin; |
||
25 | |||
26 | import java.util.ArrayList; |
||
27 | import java.util.List; |
||
28 | import org.gvsig.andami.IconThemeHelper; |
||
29 | import org.gvsig.andami.plugins.Extension; |
||
30 | import org.gvsig.andami.preferences.IPreference; |
||
31 | import org.gvsig.andami.preferences.IPreferenceExtension; |
||
32 | |||
33 | /**
|
||
34 | *
|
||
35 | * @author jjdelcerro
|
||
36 | */
|
||
37 | public class DownloaderExtension extends Extension implements IPreferenceExtension { |
||
38 | |||
39 | @Override
|
||
40 | public void initialize() { |
||
41 | IconThemeHelper.registerIcon("preferences", "downloadmanager-preferences", this); |
||
42 | } |
||
43 | |||
44 | @Override
|
||
45 | public void postInitialize() { |
||
46 | } |
||
47 | |||
48 | @Override
|
||
49 | public void execute(String action) { |
||
50 | if( action == null ) { |
||
51 | return;
|
||
52 | } |
||
53 | switch(action.toLowerCase()) {
|
||
54 | // case "tools-xml2db-createdbfromxml":
|
||
55 | // createdbFromXml();
|
||
56 | // return;
|
||
57 | // case "tools-xml2db-importxml2db":
|
||
58 | // importXml2db();
|
||
59 | // return;
|
||
60 | // case "tools-xml2db-copyxml2db":
|
||
61 | // copyXml2db();
|
||
62 | } |
||
63 | } |
||
64 | |||
65 | @Override
|
||
66 | public boolean isEnabled() { |
||
67 | return true; |
||
68 | } |
||
69 | |||
70 | @Override
|
||
71 | public boolean isVisible() { |
||
72 | return false; |
||
73 | } |
||
74 | |||
75 | @Override
|
||
76 | public IPreference[] getPreferencesPages() { |
||
77 | List<IPreference> prefs = new ArrayList<>(); |
||
78 | prefs.add(new DownloaderAuthenticatePreferencesPage());
|
||
79 | |||
80 | return prefs.toArray(new IPreference[prefs.size()]); |
||
81 | } |
||
82 | } |