|
|
@ -16,6 +16,7 @@ import com.fr.design.layout.TableLayout; |
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.design.mainframe.DesignerFrameFileDealerPane; |
|
|
|
import com.fr.design.mainframe.DesignerFrameFileDealerPane; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.manager.search.TemplateTreeSearchManager; |
|
|
|
import com.fr.design.utils.TemplateUtils; |
|
|
|
import com.fr.design.utils.TemplateUtils; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.event.EventDispatcher; |
|
|
|
import com.fr.event.EventDispatcher; |
|
|
@ -228,7 +229,7 @@ public class RenameAction extends UpdateAction { |
|
|
|
this.setSize(340, 200); |
|
|
|
this.setSize(340, 200); |
|
|
|
this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Rename")); |
|
|
|
this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Rename")); |
|
|
|
this.setResizable(false); |
|
|
|
this.setResizable(false); |
|
|
|
this.setAlwaysOnTop(true); |
|
|
|
this.setAlwaysOnTop(false); |
|
|
|
this.setIconImage(BaseUtils.readImage("/com/fr/base/images/oem/logo.png")); |
|
|
|
this.setIconImage(BaseUtils.readImage("/com/fr/base/images/oem/logo.png")); |
|
|
|
this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); |
|
|
|
this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); |
|
|
|
GUICoreUtils.centerWindow(this); |
|
|
|
GUICoreUtils.centerWindow(this); |
|
|
@ -270,11 +271,7 @@ public class RenameAction extends UpdateAction { |
|
|
|
boolean success = selectedOperation.rename(fnf, path, newPath); |
|
|
|
boolean success = selectedOperation.rename(fnf, path, newPath); |
|
|
|
|
|
|
|
|
|
|
|
if (success) { |
|
|
|
if (success) { |
|
|
|
EventDispatcher.fire(DesignerFrameFileDealerPane.TEMPLATE_RENAME, new TwoTuple<>(path, newPath)); |
|
|
|
afterRename(path, newPath); |
|
|
|
HistoryTemplateListCache.getInstance().rename(fnf, path, newPath); |
|
|
|
|
|
|
|
DesignerEnvManager.getEnvManager().replaceRecentOpenedFilePath(fnf.isDirectory(), path, newPath); |
|
|
|
|
|
|
|
selectedOperation.refreshParent(); |
|
|
|
|
|
|
|
DesignerContext.getDesignerFrame().setTitle(); |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
FineJOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), |
|
|
|
FineJOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), |
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Rename_Failure"), |
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Rename_Failure"), |
|
|
@ -284,6 +281,18 @@ public class RenameAction extends UpdateAction { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void afterRename(String path, String newPath) { |
|
|
|
|
|
|
|
EventDispatcher.fire(DesignerFrameFileDealerPane.TEMPLATE_RENAME, new TwoTuple<>(path, newPath)); |
|
|
|
|
|
|
|
HistoryTemplateListCache.getInstance().rename(fnf, path, newPath); |
|
|
|
|
|
|
|
DesignerEnvManager.getEnvManager().replaceRecentOpenedFilePath(fnf.isDirectory(), path, newPath); |
|
|
|
|
|
|
|
selectedOperation.refreshParent(); |
|
|
|
|
|
|
|
DesignerContext.getDesignerFrame().setTitle(); |
|
|
|
|
|
|
|
if (TemplateTreeSearchManager.getInstance().isInSearchMode()) { |
|
|
|
|
|
|
|
TemplateTreeSearchManager.getInstance().outOfSearchMode(); |
|
|
|
|
|
|
|
LocateAction.gotoEditingTemplateLeaf(newPath); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void validInput() { |
|
|
|
private void validInput() { |
|
|
|
|
|
|
|
|
|
|
|