@ -17,6 +17,7 @@ import com.fr.file.FILE;
import com.fr.file.FileNodeFILE ;
import com.fr.file.filetree.FileNode ;
import com.fr.file.filetree.IOFileNodeFilter ;
import com.fr.form.fit.web.editpreview.FileLockStateObservable ;
import com.fr.general.ComparatorUtils ;
import com.fr.general.IOUtils ;
import com.fr.log.FineLoggerFactory ;
@ -47,6 +48,8 @@ import java.util.Arrays;
import java.util.Collection ;
import java.util.Enumeration ;
import java.util.Objects ;
import java.util.Observable ;
import java.util.Observer ;
import static javax.swing.JOptionPane.WARNING_MESSAGE ;
import static javax.swing.JOptionPane.YES_NO_OPTION ;
@ -76,6 +79,13 @@ public class TemplateTreePane extends JPanel implements FileOperations {
scrollPane . setBorder ( null ) ;
contentPane . add ( scrollPane , BorderLayout . CENTER ) ;
FileLockStateObservable . getInstance ( ) . addObserver ( new Observer ( ) {
@Override
public void update ( Observable o , Object arg ) {
TemplateTreePane . this . refresh ( ) ;
}
} ) ;
/ *
* Tree . MouseAdapter
* /
@ -202,15 +212,13 @@ public class TemplateTreePane extends JPanel implements FileOperations {
@Override
public void openFile ( ) {
// 判断是否是远程设计的锁定文件
if ( ! WorkContext . getCurrent ( ) . isLocal ( ) ) {
FileNode node = reportletsTree . getSelectedFileNode ( ) ;
if ( node = = null ) {
return ;
}
String lock = node . getLock ( ) ;
if ( lock ! = null & & ! lock . equals ( node . getUserID ( ) ) ) {
return ;
}
FileNode node = reportletsTree . getSelectedFileNode ( ) ;
if ( node = = null ) {
return ;
}
String lock = node . getLock ( ) ;
if ( lock ! = null & & ! lock . equals ( node . getUserID ( ) ) ) {
return ;
}
String reportPath = reportletsTree . getSelectedTemplatePath ( ) ;
final String selectedFilePath = StableUtils . pathJoin ( ProjectConstants . REPORTLETS_NAME , reportPath ) ;