Revision 41264 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/ViewPropertiesExtension.java
ViewPropertiesExtension.java | ||
---|---|---|
31 | 31 |
import org.gvsig.app.gui.preferencespage.LayerOrderPage; |
32 | 32 |
import org.gvsig.app.gui.preferencespage.ViewBehaviorPage; |
33 | 33 |
import org.gvsig.app.project.documents.view.ViewDocument; |
34 |
import org.gvsig.app.project.documents.view.gui.IView; |
|
34 | 35 |
import org.gvsig.app.project.documents.view.gui.ViewProperties; |
35 | 36 |
|
36 | 37 |
public class ViewPropertiesExtension extends Extension implements IPreferenceExtension { |
... | ... | |
46 | 47 |
public void execute(String s) { |
47 | 48 |
ApplicationManager application = ApplicationLocator.getManager(); |
48 | 49 |
|
49 |
ViewDocument document = (ViewDocument) application.getActiveDocument(ViewDocument.class);
|
|
50 |
if (document == null) {
|
|
50 |
IView view = (IView) application.getActiveComponent(ViewDocument.class);
|
|
51 |
if (view == null) {
|
|
51 | 52 |
return; |
52 | 53 |
} |
54 |
ViewDocument document = view.getViewDocument(); |
|
55 |
|
|
53 | 56 |
if (s.equalsIgnoreCase("view-properties")) { |
54 | 57 |
ViewProperties viewProperties = new ViewProperties(document); |
55 | 58 |
application.getUIManager().addWindow(viewProperties); |
... | ... | |
66 | 69 |
public boolean isVisible() { |
67 | 70 |
ApplicationManager application = ApplicationLocator.getManager(); |
68 | 71 |
|
69 |
return application.getActiveDocument(ViewDocument.class) != null;
|
|
72 |
return application.getActiveComponent(ViewDocument.class) != null;
|
|
70 | 73 |
} |
71 | 74 |
|
72 | 75 |
public IPreference[] getPreferencesPages() { |
Also available in: Unified diff