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