Revision 3365 org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.swing/org.gvsig.vcsgis.swing.impl/src/main/java/org/gvsig/vcsgis/swing/impl/changes/RemoteChangesController.java
RemoteChangesController.java | ||
---|---|---|
43 | 43 |
import javax.swing.table.DefaultTableModel; |
44 | 44 |
import org.apache.commons.lang3.BooleanUtils; |
45 | 45 |
import org.apache.commons.lang3.StringUtils; |
46 |
import org.apache.commons.lang3.mutable.MutableLong; |
|
46 | 47 |
import org.gvsig.featureform.swing.JFeatureForm; |
47 | 48 |
import org.gvsig.fmap.dal.feature.Feature; |
48 | 49 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
... | ... | |
86 | 87 |
import static org.gvsig.vcsgis.swing.impl.VCSGisSwingCommons.cleanHighligthed; |
87 | 88 |
import static org.gvsig.vcsgis.swing.impl.VCSGisSwingCommons.notInSwingThreadInvokeLater; |
88 | 89 |
import static org.gvsig.vcsgis.swing.impl.VCSGisSwingCommons.refreshDocument; |
90 |
import static org.gvsig.vcsgis.swing.impl.changes.VCSGisJChangesImpl.LOCAL_TAB_INDEX; |
|
89 | 91 |
import org.slf4j.Logger; |
90 | 92 |
import org.slf4j.LoggerFactory; |
91 | 93 |
|
... | ... | |
555 | 557 |
try { |
556 | 558 |
context.processing = true; |
557 | 559 |
context.doUpdateComponents(); |
560 |
MutableLong localChangesCreated = new MutableLong(0); |
|
558 | 561 |
int r = getWorkspace().merge( |
559 | 562 |
tableName, |
563 |
localChangesCreated, |
|
560 | 564 |
this.context.getTaskStatusController().getSimpleTaskStatus() |
561 | 565 |
); |
562 |
doPostMerge(r); |
|
566 |
doPostMerge(r, localChangesCreated.getValue());
|
|
563 | 567 |
} finally { |
564 | 568 |
context.processing = false; |
565 | 569 |
context.doUpdateComponents(); |
... | ... | |
570 | 574 |
task.start(); |
571 | 575 |
} |
572 | 576 |
|
573 |
private void doPostMerge(int mergeStatus) { |
|
574 |
if (notInSwingThreadInvokeLater(() -> {doPostMerge(mergeStatus);})) { |
|
577 |
private void doPostMerge(int mergeStatus, long localChangesCreated) {
|
|
578 |
if (notInSwingThreadInvokeLater(() -> {doPostMerge(mergeStatus, localChangesCreated);})) {
|
|
575 | 579 |
return; |
576 | 580 |
} |
577 | 581 |
if (mergeStatus == ERR_OK) { |
... | ... | |
582 | 586 |
FeatureStore store = getWorkspace().getFeatureStore(selectedTable.getEntityName()); |
583 | 587 |
refreshDocument(store); |
584 | 588 |
|
589 |
if(localChangesCreated>0){ |
|
590 |
ThreadSafeDialogsManager dialogsManager = ToolsSwingLocator.getThreadSafeDialogsManager(); |
|
591 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
592 |
dialogsManager.messageDialog( |
|
593 |
i18n.getTranslation("_The_process_has_created_local_changes_that_would_need_to_be_committed_to_the_repository"), |
|
594 |
null, |
|
595 |
i18n.getTranslation("_VCSGis_Merge"), |
|
596 |
JOptionPane.INFORMATION_MESSAGE, |
|
597 |
"VCSGIS_merge_need_commit"); |
|
598 |
context.selectTab(LOCAL_TAB_INDEX); |
|
599 |
context.selectOnlyALocalEntity(selectedTable); |
|
600 |
} |
|
585 | 601 |
context.doUpdateComponents(); |
586 | 602 |
context.updateLocalChangesTable(); |
587 | 603 |
} |
Also available in: Unified diff