|
|
|
@ -6,6 +6,7 @@ import com.fr.design.dialog.DialogActionAdapter;
|
|
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
import com.fr.design.lock.LockInfoUtils; |
|
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
|
import com.fr.design.mainframe.vcs.VcsOperatorWorker; |
|
|
|
|
|
|
|
|
@ -15,6 +16,7 @@ import com.fr.design.mainframe.vcs.common.VcsCloseTemplateHelper;
|
|
|
|
|
import com.fr.file.FileNodeFILE; |
|
|
|
|
import com.fr.file.filetree.FileNode; |
|
|
|
|
import com.fr.report.entity.VcsEntity; |
|
|
|
|
import com.fr.report.lock.LockInfoOperator; |
|
|
|
|
import com.fr.stable.StableUtils; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.fr.stable.project.ProjectConstants; |
|
|
|
@ -25,10 +27,13 @@ import javax.swing.Icon;
|
|
|
|
|
import javax.swing.JComponent; |
|
|
|
|
import javax.swing.JOptionPane; |
|
|
|
|
import javax.swing.JTable; |
|
|
|
|
import javax.swing.SwingWorker; |
|
|
|
|
import javax.swing.UIManager; |
|
|
|
|
import java.awt.event.MouseAdapter; |
|
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.concurrent.ExecutionException; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -148,12 +153,39 @@ public class VcsCenterPane extends VcsNewPane {
|
|
|
|
|
if (o instanceof VcsTableEntity) { |
|
|
|
|
VcsEntity entity = ((VcsTableEntity) o).getEntity(); |
|
|
|
|
saveSettingAndCloseDialog(); |
|
|
|
|
DesignerContext.getDesignerFrame().openTemplate(new FileNodeFILE(new FileNode(getTemplateTruePath(entity.getFilename()), false))); |
|
|
|
|
showTemplate(entity.getFilename(), new FileNode(getTemplateTruePath(entity.getFilename()), false)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void showTemplate(String filename, FileNode node) { |
|
|
|
|
new SwingWorker<Boolean, Void>() { |
|
|
|
|
@Override |
|
|
|
|
protected Boolean doInBackground() throws Exception { |
|
|
|
|
String selectedFilePath = getTemplateTruePath(filename); |
|
|
|
|
String lock = node.getLock(); |
|
|
|
|
return LockInfoUtils.isCompatibleOperator() |
|
|
|
|
|| LockInfoUtils.unableGetLockInfo() |
|
|
|
|
|| WorkContext.getCurrent().get(LockInfoOperator.class).isTplUnLocked(selectedFilePath) |
|
|
|
|
? (lock != null && !lock.equals(node.getUserID())) |
|
|
|
|
: WorkContext.getCurrent().get(LockInfoOperator.class).isTplLocked(selectedFilePath); |
|
|
|
|
} |
|
|
|
|
@Override |
|
|
|
|
protected void done() { |
|
|
|
|
try { |
|
|
|
|
if (!get()) { |
|
|
|
|
DesignerContext.getDesignerFrame().openTemplate(new FileNodeFILE(node)); |
|
|
|
|
} else { |
|
|
|
|
FineJOptionPane.showMessageDialog(VcsCenterPane.this, Toolkit.i18nText("Fine-Design_Vcs_Open_Lock_Tip"), UIManager.getString("OptionPane.messageDialogTitle"), JOptionPane.ERROR_MESSAGE); |
|
|
|
|
} |
|
|
|
|
} catch (InterruptedException | ExecutionException e) { |
|
|
|
|
throw new RuntimeException(e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}.execute(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void initManagerListener() { |
|
|
|
|
manager.addMouseListener(new MouseAdapter() { |
|
|
|
|
@Override |
|
|
|
|