Revision 44395 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.exportto/org.gvsig.exportto.swing/org.gvsig.exportto.swing.impl/src/main/java/org/gvsig/export/swing/impl/panels/SelectFormatPanel.java
SelectFormatPanel.java | ||
---|---|---|
18 | 18 |
import org.gvsig.export.swing.spi.ExportPanel; |
19 | 19 |
import org.gvsig.export.swing.spi.ExportPanelValidationException; |
20 | 20 |
import org.gvsig.tools.ToolsLocator; |
21 |
import org.gvsig.tools.bookmarksandhistory.Bookmark; |
|
21 | 22 |
import org.gvsig.tools.bookmarksandhistory.Bookmarks; |
22 | 23 |
import org.gvsig.tools.bookmarksandhistory.History; |
23 | 24 |
import org.gvsig.tools.i18n.I18nManager; |
... | ... | |
28 | 29 |
import static org.gvsig.tools.swing.api.bookmarkshistory.ActionEventWithCurrentValue.ID_SETVALUE; |
29 | 30 |
import org.gvsig.tools.swing.api.bookmarkshistory.BookmarksController; |
30 | 31 |
import org.gvsig.tools.swing.api.bookmarkshistory.HistoryController; |
31 |
import org.gvsig.tools.swing.api.bookmarkshistory.HistoryController.HistoryEvent; |
|
32 | 32 |
import org.slf4j.Logger; |
33 | 33 |
import org.slf4j.LoggerFactory; |
34 | 34 |
|
... | ... | |
86 | 86 |
return; |
87 | 87 |
} |
88 | 88 |
doUpdateDescription(); |
89 |
// doUpdateFilter(); |
|
90 | 89 |
} |
91 | 90 |
}); |
92 |
|
|
91 |
|
|
93 | 92 |
Predicate<ExportParameters> filter = new Predicate<ExportParameters>() { |
94 | 93 |
@Override |
95 | 94 |
public boolean test(ExportParameters params) { |
96 | 95 |
if (params == null) { |
97 | 96 |
return false; |
98 | 97 |
} |
99 |
ExportServiceFactory selectedService = SelectFormatPanel.this.getSelectedService();
|
|
98 |
ExportServiceFactory selectedService = getSelectedService(); |
|
100 | 99 |
if (selectedService == null) { |
101 | 100 |
return false; |
102 | 101 |
} |
103 | 102 |
String selectedServiceName = selectedService.getName(); |
104 | 103 |
String paramsServiceName = params.getServiceName(); |
105 |
return StringUtils.equals(paramsServiceName,selectedServiceName); |
|
104 |
return StringUtils.equals(paramsServiceName, selectedServiceName);
|
|
106 | 105 |
} |
107 | 106 |
}; |
108 | 107 |
ActionListener historyAndBookmarkListener = new ActionListener() { |
109 | 108 |
@Override |
110 | 109 |
public void actionPerformed(ActionEvent e) { |
111 | 110 |
ActionEventWithCurrentValue<ExportParameters> b = (ActionEventWithCurrentValue<ExportParameters>) e; |
112 |
switch(b.getID()) { |
|
111 |
switch (b.getID()) {
|
|
113 | 112 |
case ID_GETVALUE: |
114 | 113 |
// Esta deshabilitado esta opcion |
115 | 114 |
break; |
... | ... | |
136 | 135 |
Bookmarks<ExportParameters> bookmarks = ExportLocator.getManager().getBookmarks(); |
137 | 136 |
this.bookmarksController = ToolsSwingLocator.getToolsSwingManager().createBookmarksController(bookmarks, this.btnBookmark); |
138 | 137 |
this.bookmarksController.setAllowAddBookmarks(false); |
139 |
this.bookmarksController.setFilter(filter); |
|
138 |
this.bookmarksController.setFilter(new Predicate<Bookmark<ExportParameters>>() { |
|
139 |
@Override |
|
140 |
public boolean test(Bookmark<ExportParameters> bookmark) { |
|
141 |
ExportParameters params = bookmark.getValue(); |
|
142 |
if (params == null) { |
|
143 |
return false; |
|
144 |
} |
|
145 |
ExportServiceFactory selectedService = getSelectedService(); |
|
146 |
if (selectedService == null) { |
|
147 |
return true; |
|
148 |
} |
|
149 |
String selectedServiceName = selectedService.getName(); |
|
150 |
String paramsServiceName = params.getServiceName(); |
|
151 |
return StringUtils.equals(paramsServiceName, selectedServiceName); |
|
152 |
} |
|
153 |
}); |
|
140 | 154 |
this.bookmarksController.addActionListener(historyAndBookmarkListener); |
141 | 155 |
History<ExportParameters> history = ExportLocator.getManager().getHistory(); |
142 | 156 |
this.historyController = ToolsSwingLocator.getToolsSwingManager().createHistoryController(history, this.btnHistory); |
Also available in: Unified diff