@ -207,7 +207,7 @@ public class DefaultTemplateTreeDefineProcessor extends AbstractTemplateTreeDefi
for ( ExpandMutableTreeNode treeNode : treeNodeList ) {
FileOperationHelper . getInstance ( ) . checkFreeOrLock ( treeNode , pasteNodes , lockedNodes ) ;
}
if ( pasteNodes . isEmpty ( ) ) {
if ( pasteNodes . isEmpty ( ) | | ! lockedNodes . isEmpty ( ) ) {
//提示:复制的文件都不能黏贴
FineJOptionPane . showMessageDialog ( DesignerContext . getDesignerFrame ( ) ,
Toolkit . i18nText ( "Fine-Design_Basic_Confirm_Paste_Unlock_File" ) ,
@ -215,18 +215,7 @@ public class DefaultTemplateTreeDefineProcessor extends AbstractTemplateTreeDefi
WARNING_MESSAGE ) ;
return ;
}
if ( lockedNodes . isEmpty ( ) ) {
doPaste ( targetDir , pasteNodes ) ;
} else {
if ( FineJOptionPane . showConfirmDialog ( DesignerContext . getDesignerFrame ( ) ,
Toolkit . i18nText ( "Fine-Design_Basic_Confirm_Paste_Other_File" ) ,
Toolkit . i18nText ( "Fine-Design_Basic_Confirm" ) ,
YES_NO_OPTION )
= = JOptionPane . YES_OPTION ) {
// 黏贴其他可黏贴的文件
doPaste ( targetDir , pasteNodes ) ;
}
}
doPaste ( targetDir , pasteNodes ) ;
}
/ * *
@ -329,21 +318,20 @@ public class DefaultTemplateTreeDefineProcessor extends AbstractTemplateTreeDefi
WARNING_MESSAGE ) ;
return ;
}
// 筛选可以移动的文件
ArrayList < ExpandMutableTreeNode > moveNodes = new ArrayList < > ( ) ;
ArrayList < ExpandMutableTreeNode > lockedNodes = new ArrayList < > ( ) ;
for ( ExpandMutableTreeNode treeNode : getFileTree ( ) . getSelectedTreeNodes ( ) ) {
FileOperationHelper . getInstance ( ) . checkFreeOrLock ( treeNode , moveNodes , lockedNodes ) ;
}
ExpandMutableTreeNode [ ] selectedTreeNodes = getFileTree ( ) . getSelectedTreeNodes ( ) ;
for ( ExpandMutableTreeNode treeNode : selectedTreeNodes ) {
if ( treeNode . getUserObject ( ) instanceof FileNode ) {
FileNode node = ( FileNode ) treeNode . getUserObject ( ) ;
String lock = node . getLock ( ) ;
if ( lock ! = null & & ! lock . equals ( node . getUserID ( ) ) ) {
// 提醒被锁定模板无法移动
FineJOptionPane . showMessageDialog ( DesignerContext . getDesignerFrame ( ) ,
Toolkit . i18nText ( "Fine-Design_Basic_Unable_Move_Locked_File" ) ,
Toolkit . i18nText ( "Fine-Design_Basic_Alert" ) ,
WARNING_MESSAGE ) ;
return ;
}
}
if ( ! lockedNodes . isEmpty ( ) ) {
// 提醒被锁定模板无法移动
FineJOptionPane . showMessageDialog ( DesignerContext . getDesignerFrame ( ) ,
Toolkit . i18nText ( "Fine-Design_Basic_Unable_Move_Locked_File" ) ,
Toolkit . i18nText ( "Fine-Design_Basic_Alert" ) ,
WARNING_MESSAGE ) ;
return ;
}
new TemplateMoveDialog ( ) ;