Revision 38564 branches/v2_0_0_prep/extensions/extDalTransformJoin/src/org/gvsig/app/join/RemoveTableUnion.java
RemoveTableUnion.java | ||
---|---|---|
1 | 1 |
package org.gvsig.app.join; |
2 | 2 |
|
3 |
import org.gvsig.andami.IconThemeHelper; |
|
3 | 4 |
import org.gvsig.andami.PluginServices; |
4 | 5 |
import org.gvsig.andami.plugins.Extension; |
5 | 6 |
import org.gvsig.andami.ui.mdiManager.IWindow; |
... | ... | |
20 | 21 |
* @see org.gvsig.andami.plugins.IExtension#initialize() |
21 | 22 |
*/ |
22 | 23 |
public void initialize() { |
23 |
// TODO Auto-generated method stub |
|
24 |
|
|
24 |
IconThemeHelper.registerIcon("action", "table-remove-join", this); |
|
25 | 25 |
} |
26 | 26 |
|
27 | 27 |
/** |
28 | 28 |
* @see org.gvsig.andami.plugins.IExtension#execute(java.lang.String) |
29 | 29 |
*/ |
30 | 30 |
public void execute(String actionCommand) { |
31 |
FeatureTableDocumentPanel t = (FeatureTableDocumentPanel) PluginServices.getMDIManager().getActiveWindow(); |
|
32 |
TableDocument pt = t.getModel(); |
|
33 |
FeatureStore fs = pt.getStore(); |
|
34 |
this.removeJoinTransfor(fs); |
|
35 |
|
|
36 |
// TODO |
|
37 |
// if (fs instanceof JoinFeatureStore) { |
|
38 |
// DataManager dm = DALLocator.getDataManager(); |
|
39 |
// DataStoreParameters originalParams = ((JoinFeatureStoreParameters) fs |
|
40 |
// .getParameters()).getStorePrimary(); |
|
41 |
// FeatureStore original = null; |
|
42 |
// try { |
|
43 |
// original = (FeatureStore) dm.createStore(originalParams); |
|
44 |
// } catch (InitializeException e) { |
|
45 |
// NotificationManager.addError(e.getMessage(), e); |
|
46 |
// return; |
|
47 |
// } |
|
48 |
// |
|
49 |
// pt.setStore(original); |
|
50 |
// try { |
|
51 |
// fs.dispose(); |
|
52 |
// } catch (CloseException e) { |
|
53 |
// NotificationManager.addError(e); |
|
54 |
// } |
|
55 |
// t.setModel(pt); |
|
56 |
// |
|
57 |
// } |
|
58 |
|
|
59 |
// t.clearSelectedFields(); |
|
60 |
t.getModel().setModified(true); |
|
31 |
if( "table-remove-join".equalsIgnoreCase(actionCommand)) { |
|
32 |
FeatureTableDocumentPanel t = (FeatureTableDocumentPanel) PluginServices.getMDIManager().getActiveWindow(); |
|
33 |
TableDocument pt = t.getModel(); |
|
34 |
FeatureStore fs = pt.getStore(); |
|
35 |
this.removeJoinTransfor(fs); |
|
36 |
|
|
37 |
// TODO |
|
38 |
// if (fs instanceof JoinFeatureStore) { |
|
39 |
// DataManager dm = DALLocator.getDataManager(); |
|
40 |
// DataStoreParameters originalParams = ((JoinFeatureStoreParameters) fs |
|
41 |
// .getParameters()).getStorePrimary(); |
|
42 |
// FeatureStore original = null; |
|
43 |
// try { |
|
44 |
// original = (FeatureStore) dm.createStore(originalParams); |
|
45 |
// } catch (InitializeException e) { |
|
46 |
// NotificationManager.addError(e.getMessage(), e); |
|
47 |
// return; |
|
48 |
// } |
|
49 |
// |
|
50 |
// pt.setStore(original); |
|
51 |
// try { |
|
52 |
// fs.dispose(); |
|
53 |
// } catch (CloseException e) { |
|
54 |
// NotificationManager.addError(e); |
|
55 |
// } |
|
56 |
// t.setModel(pt); |
|
57 |
// |
|
58 |
// } |
|
59 |
|
|
60 |
// t.clearSelectedFields(); |
|
61 |
t.getModel().setModified(true); |
|
62 |
} |
|
61 | 63 |
} |
62 | 64 |
|
63 | 65 |
public void removeJoinTransfor(FeatureStore store) { |
Also available in: Unified diff