|
|
|
@ -32,7 +32,7 @@ import com.fr.design.mainframe.bbs.UserInfoLabel;
|
|
|
|
|
import com.fr.design.mainframe.bbs.UserInfoPane; |
|
|
|
|
import com.fr.design.mainframe.template.info.TemplateInfoCollector; |
|
|
|
|
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; |
|
|
|
|
import com.fr.design.mainframe.vcs.proxy.VcsCacheFileNodeFile; |
|
|
|
|
import com.fr.design.mainframe.vcs.common.VcsCacheFileNodeFile; |
|
|
|
|
import com.fr.design.mainframe.vcs.ui.FileVersionTable; |
|
|
|
|
import com.fr.design.menu.KeySetUtils; |
|
|
|
|
import com.fr.design.menu.MenuDef; |
|
|
|
@ -295,14 +295,20 @@ public class Designer extends BaseDesigner {
|
|
|
|
|
private void dealWithVcs(JTemplate jt) { |
|
|
|
|
String fileName = VcsHelper.getEditingFilename(); |
|
|
|
|
VcsEntity entity = WorkContext.getCurrent().get(VcsOperator.class).getLatestFileVersion(fileName); |
|
|
|
|
int latestFileVersion = entity == null ? 0 : entity.getVersion(); |
|
|
|
|
if (jt.getEditingFILE() instanceof VcsCacheFileNodeFile) { |
|
|
|
|
WorkContext.getCurrent().get(VcsOperator.class).saveVersionFromCache(VcsHelper.CURRENT_USERNAME, fileName, StringUtils.EMPTY, latestFileVersion + 1); |
|
|
|
|
String path = DesignerFrameFileDealerPane.getInstance().getSelectedOperation().getFilePath(); |
|
|
|
|
FileVersionTable.getInstance().updateModel(1, WorkContext.getCurrent().get(VcsOperator.class).getVersions(path.replaceFirst("/", ""))); |
|
|
|
|
} else { |
|
|
|
|
WorkContext.getCurrent().get(VcsOperator.class).saveVersion(VcsHelper.CURRENT_USERNAME, fileName, StringUtils.EMPTY, latestFileVersion + 1); |
|
|
|
|
int latestFileVersion = 0; |
|
|
|
|
if (entity != null) { |
|
|
|
|
latestFileVersion = entity.getVersion(); |
|
|
|
|
} |
|
|
|
|
if (VcsHelper.needSaveVersion(entity)) { |
|
|
|
|
if (jt.getEditingFILE() instanceof VcsCacheFileNodeFile) { |
|
|
|
|
WorkContext.getCurrent().get(VcsOperator.class).saveVersionFromCache(VcsHelper.CURRENT_USERNAME, fileName, StringUtils.EMPTY, latestFileVersion + 1); |
|
|
|
|
String path = DesignerFrameFileDealerPane.getInstance().getSelectedOperation().getFilePath(); |
|
|
|
|
FileVersionTable.getInstance().updateModel(1, WorkContext.getCurrent().get(VcsOperator.class).getVersions(path.replaceFirst("/", ""))); |
|
|
|
|
} else { |
|
|
|
|
WorkContext.getCurrent().get(VcsOperator.class).saveVersion(VcsHelper.CURRENT_USERNAME, fileName, StringUtils.EMPTY, latestFileVersion + 1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private UIButton createUndoButton() { |
|
|
|
|