svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.app / org.gvsig.app.mainplugin / src / main / java / org / gvsig / app / project / documents / view / legend / gui / InformationPropertiesPage.java @ 43142
History | View | Annotate | Download (1.46 KB)
1 |
package org.gvsig.app.project.documents.view.legend.gui; |
---|---|
2 |
|
3 |
import javax.swing.JComponent; |
4 |
|
5 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
6 |
import org.gvsig.propertypage.PropertiesPage; |
7 |
import org.gvsig.tools.ToolsLocator; |
8 |
import org.gvsig.tools.i18n.I18nManager; |
9 |
|
10 |
|
11 |
/**
|
12 |
* @author fdiaz
|
13 |
*
|
14 |
*/
|
15 |
public class InformationPropertiesPage extends javax.swing.JPanel implements PropertiesPage { |
16 |
|
17 |
/**
|
18 |
*
|
19 |
*/
|
20 |
private static final long serialVersionUID = -912777742097628569L; |
21 |
private InformationPanelController informationPanel;
|
22 |
private final FLayer layer; |
23 |
|
24 |
|
25 |
|
26 |
public InformationPropertiesPage(FLayer layer) {
|
27 |
this.layer = layer;
|
28 |
} |
29 |
|
30 |
@Override
|
31 |
public JComponent asJComponent() { |
32 |
if (this.informationPanel == null) { |
33 |
informationPanel = new InformationPanelController();
|
34 |
informationPanel.set(layer); |
35 |
} |
36 |
return (JComponent) informationPanel; |
37 |
} |
38 |
|
39 |
@Override
|
40 |
public String getTitle() { |
41 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
42 |
return i18nManager.getTranslation("_information"); |
43 |
} |
44 |
|
45 |
@Override
|
46 |
public int getPriority() { |
47 |
return 1000; |
48 |
} |
49 |
|
50 |
@Override
|
51 |
public boolean whenAccept() { |
52 |
this.whenApply();
|
53 |
return true; |
54 |
} |
55 |
|
56 |
@Override
|
57 |
public boolean whenApply() { |
58 |
this.informationPanel.fetch(layer);
|
59 |
return true; |
60 |
} |
61 |
|
62 |
@Override
|
63 |
public boolean whenCancel() { |
64 |
// Do nothing
|
65 |
return true; |
66 |
} |
67 |
|
68 |
} |