Revision 43557
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.snapping.app/org.gvsig.snapping.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/gui/ViewSnappingPropertiesPageFactory.java | ||
---|---|---|
8 | 8 |
|
9 | 9 |
public class ViewSnappingPropertiesPageFactory implements PropertiesPageFactory { |
10 | 10 |
|
11 |
public String getName() { |
|
12 |
return "Snapping"; |
|
13 |
} |
|
14 |
|
|
11 | 15 |
public boolean isVisible(Object obj) { |
12 | 16 |
// Always if enabled this page |
13 | 17 |
return true; |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app.document.table.app/org.gvsig.app.document.table.app.mainplugin/src/main/java/org/gvsig/app/project/documents/table/gui/GeneralTablePropertiesPageFactory.java | ||
---|---|---|
2 | 2 |
package org.gvsig.app.project.documents.table.gui; |
3 | 3 |
|
4 | 4 |
import org.gvsig.app.project.documents.table.TableDocument; |
5 |
import org.gvsig.app.project.documents.view.ViewDocument; |
|
6 | 5 |
import org.gvsig.propertypage.PropertiesPage; |
7 | 6 |
import org.gvsig.propertypage.PropertiesPageFactory; |
8 | 7 |
|
9 | 8 |
|
10 | 9 |
public class GeneralTablePropertiesPageFactory implements PropertiesPageFactory { |
11 | 10 |
|
11 |
@Override |
|
12 | 12 |
public boolean isVisible(Object obj) { |
13 | 13 |
// Always if enabled this page |
14 | 14 |
return true; |
15 | 15 |
} |
16 | 16 |
|
17 |
@Override |
|
18 |
public String getName() { |
|
19 |
return "General"; |
|
20 |
} |
|
21 |
|
|
22 |
@Override |
|
17 | 23 |
public PropertiesPage create(Object obj) { |
18 | 24 |
return new GeneralTablePropertiesPage((TableDocument)obj); |
19 | 25 |
} |
20 | 26 |
|
27 |
@Override |
|
21 | 28 |
public String getGroupID() { |
22 | 29 |
return TableDocument.TABLE_PROPERTIES_PAGE_GROUP; |
23 | 30 |
} |
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/GeneralLayerPropertiesPage.java | ||
---|---|---|
37 | 37 |
} |
38 | 38 |
|
39 | 39 |
@Override |
40 |
public String getName() { |
|
41 |
return "General"; |
|
42 |
} |
|
43 |
|
|
44 |
@Override |
|
40 | 45 |
public boolean isVisible(Object obj) { |
41 | 46 |
return obj instanceof FLayer; |
42 | 47 |
} |
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/ThemeManagerWindow.java | ||
---|---|---|
57 | 57 |
this.pageClass = pageClass; |
58 | 58 |
} |
59 | 59 |
|
60 |
@Override |
|
61 |
public String getName() { |
|
62 |
return this.pageClass.getName(); |
|
63 |
} |
|
64 |
|
|
60 | 65 |
private AbstractThemeManagerPage getPage(FLayer layer) throws InstantiationException, IllegalAccessException { |
61 | 66 |
if (this.layer == null || this.layer != layer) { |
62 | 67 |
AbstractThemeManagerPage p = pageClass.newInstance(); |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/gui/GeneralViewPropertiesPageFactory.java | ||
---|---|---|
13 | 13 |
return true; |
14 | 14 |
} |
15 | 15 |
|
16 |
@Override |
|
17 |
public String getName() { |
|
18 |
return "General"; |
|
19 |
} |
|
20 |
|
|
16 | 21 |
public PropertiesPage create(Object obj) { |
17 | 22 |
return new GeneralViewPropertiesPage((ViewDocument)obj); |
18 | 23 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/gui/ProjectGeneralPropertiesPageFactory.java | ||
---|---|---|
10 | 10 |
public String getGroupID() { |
11 | 11 |
return Project.PROJECT_PROPERTIES_PAGE_GROUP; |
12 | 12 |
} |
13 |
|
|
14 |
@Override |
|
15 |
public String getName() { |
|
16 |
return "General"; |
|
17 |
} |
|
13 | 18 |
|
14 | 19 |
public boolean isVisible(Object obj) { |
15 | 20 |
// Always if enabled this page |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.fmap.control/src/main/java/org/gvsig/propertypage/PropertiesPageFactory.java | ||
---|---|---|
3 | 3 |
|
4 | 4 |
public interface PropertiesPageFactory { |
5 | 5 |
|
6 |
public String getName(); |
|
7 |
|
|
6 | 8 |
/** |
7 | 9 |
* Return the group identifier. |
8 | 10 |
* The group identifier identify the object that store the properties that |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.fmap.control/src/main/java/org/gvsig/propertypage/impl/DefaultPropertiesPageManager.java | ||
---|---|---|
1 | 1 |
package org.gvsig.propertypage.impl; |
2 | 2 |
|
3 | 3 |
import java.util.ArrayList; |
4 |
import java.util.Collection; |
|
4 | 5 |
import java.util.Collections; |
5 | 6 |
import java.util.Comparator; |
6 | 7 |
import java.util.HashMap; |
... | ... | |
21 | 22 |
|
22 | 23 |
private static final Logger logger = LoggerFactory.getLogger(DefaultPropertiesPageManager.class); |
23 | 24 |
|
24 |
private final Map<String, List<PropertiesPageFactory>> groups = new HashMap<>();
|
|
25 |
private final Map<String, Map<String, PropertiesPageFactory>> groups = new HashMap<>();
|
|
25 | 26 |
|
26 | 27 |
public DefaultPropertiesPageManager() { |
27 | 28 |
|
... | ... | |
30 | 31 |
@Override |
31 | 32 |
public void registerFactory(PropertiesPageFactory factory) { |
32 | 33 |
logger.info("Register PropertisPageFactory " + factory.getClass().getName() + " , groupID=" + factory.getGroupID() + " (" + factory.toString() + ")."); |
33 |
List<PropertiesPageFactory> group = this.getFactories(factory.getGroupID());
|
|
34 |
group.add(factory);
|
|
34 |
Map<String, PropertiesPageFactory> group = this.getFactories(factory.getGroupID());
|
|
35 |
group.put(factory.getName(), factory);
|
|
35 | 36 |
} |
36 | 37 |
|
37 |
private List<PropertiesPageFactory> getFactories(String groupID) {
|
|
38 |
private Map<String, PropertiesPageFactory> getFactories(String groupID) {
|
|
38 | 39 |
logger.info("get propeties page factories for groupID '" + groupID + "'"); |
39 |
List<PropertiesPageFactory> group = this.groups.get(groupID);
|
|
40 |
Map<String,PropertiesPageFactory> group = this.groups.get(groupID);
|
|
40 | 41 |
if (group == null) { |
41 |
group = new ArrayList<>();
|
|
42 |
group = new HashMap<>();
|
|
42 | 43 |
this.groups.put(groupID, group); |
43 | 44 |
} |
44 | 45 |
return group; |
... | ... | |
54 | 55 |
return pages; // Empty list, no access to pages authoriced |
55 | 56 |
} |
56 | 57 |
|
57 |
List<PropertiesPageFactory> factories = this.getFactories(groupID);
|
|
58 |
Collection<PropertiesPageFactory> factories = this.getFactories(groupID).values();
|
|
58 | 59 |
String authorizationId = ACCESS_PAGE_AUTHORIZATION+"-"+groupID; |
59 | 60 |
for (PropertiesPageFactory factory : factories) { |
60 | 61 |
if (factory.isVisible(obj)) { |
... | ... | |
65 | 66 |
} |
66 | 67 |
} |
67 | 68 |
Collections.sort(pages, new Comparator<PropertiesPage>() { |
69 |
@Override |
|
68 | 70 |
public int compare(PropertiesPage f1, PropertiesPage f2) { |
69 | 71 |
int n = f2.getPriority() - f1.getPriority(); |
70 | 72 |
if (n != 0) { |
Also available in: Unified diff