Revision 22931
branches/v2_0_0_prep/applications/appgvSIG/src/com/iver/cit/gvsig/TableOperations.java | ||
---|---|---|
42 | 42 |
|
43 | 43 |
import java.awt.Component; |
44 | 44 |
import java.awt.Dimension; |
45 |
import java.io.IOException; |
|
46 | 45 |
import java.util.Iterator; |
47 | 46 |
|
48 | 47 |
import javax.swing.JOptionPane; |
... | ... | |
51 | 50 |
import org.gvsig.fmap.data.DataManager; |
52 | 51 |
import org.gvsig.fmap.data.ReadException; |
53 | 52 |
import org.gvsig.fmap.data.feature.Feature; |
54 |
import org.gvsig.fmap.data.feature.FeatureAttributeDescriptor; |
|
55 | 53 |
import org.gvsig.fmap.data.feature.FeatureCollection; |
56 | 54 |
import org.gvsig.fmap.data.feature.FeatureStore; |
57 | 55 |
import org.gvsig.fmap.data.feature.MemoryFeatureCollection; |
58 | 56 |
import org.gvsig.fmap.data.feature.joinstore.JoinFeatureStore; |
59 | 57 |
import org.gvsig.fmap.data.feature.joinstore.JoinFeatureStoreParameters; |
60 |
import org.gvsig.fmap.mapcontext.layers.FBitSet; |
|
61 |
import org.gvsig.fmap.mapcontext.layers.LayerFactory; |
|
62 | 58 |
|
63 | 59 |
import com.iver.andami.PluginServices; |
64 | 60 |
import com.iver.andami.messages.NotificationManager; |
... | ... | |
94 | 90 |
public void execute(String actionCommand) { |
95 | 91 |
ProjectExtension pe = (ProjectExtension) PluginServices.getExtension(ProjectExtension.class); |
96 | 92 |
Project project=pe.getProject(); |
97 |
ProjectTable[] pts = (ProjectTable[]) project.getDocumentsByType(ProjectTableFactory.registerName)
|
|
93 |
ProjectTable[] pts = project.getDocumentsByType(ProjectTableFactory.registerName) |
|
98 | 94 |
.toArray(new ProjectTable[0]); |
99 | 95 |
if ("JOIN".equals(actionCommand)) { |
100 | 96 |
try { |
... | ... | |
156 | 152 |
ProjectTable projectTable = (ProjectTable) sourceTable.getSelected(); |
157 | 153 |
projectTable.setModel(jfs); |
158 | 154 |
IWindow[] windows=PluginServices.getMDIManager().getAllWindows(); |
155 |
Table tableWindow; |
|
159 | 156 |
for (int i = 0; i < windows.length; i++) { |
160 | 157 |
if (windows[i] instanceof Table){ |
161 |
if (((Table)windows[i]).getModel().equals(projectTable)){ |
|
162 |
jfs.addObserver((Table)windows[i]); |
|
158 |
tableWindow = (Table) windows[i]; |
|
159 |
if (tableWindow.getModel().equals( |
|
160 |
projectTable)) { |
|
161 |
tableWindow.setModel(projectTable); |
|
163 | 162 |
} |
164 | 163 |
} |
165 | 164 |
} |
... | ... | |
404 | 403 |
int pos; |
405 | 404 |
|
406 | 405 |
// Remove last ';' if exists |
407 |
if (subExpression.charAt(subExpression.length() -1) == ';') |
|
406 |
if (subExpression.charAt(subExpression.length() -1) == ';') {
|
|
408 | 407 |
subExpression = subExpression.substring(0, subExpression.length() -1).trim(); |
408 |
} |
|
409 | 409 |
|
410 | 410 |
// If there is no 'where' clause |
411 |
if ((pos = subExpression.indexOf("where")) == -1) |
|
411 |
if ((pos = subExpression.indexOf("where")) == -1) {
|
|
412 | 412 |
return false; |
413 |
} |
|
413 | 414 |
|
414 | 415 |
// If there is no subexpression in the WHERE clause -> true |
415 | 416 |
subExpression = subExpression.substring(pos + 5, subExpression.length()).trim(); // + 5 is the length of 'where' |
416 |
if ( subExpression.length() == 0 ) |
|
417 |
if ( subExpression.length() == 0 ) {
|
|
417 | 418 |
return true; |
418 |
else
|
|
419 |
} else {
|
|
419 | 420 |
return false; |
421 |
} |
|
420 | 422 |
} |
421 | 423 |
|
422 | 424 |
/** |
Also available in: Unified diff