Browse Source

method name

master
rinoux 6 years ago
parent
commit
28298be0d6
  1. 2
      designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java
  2. 4
      designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java
  3. 10
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java
  4. 2
      designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java
  5. 19
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  6. 4
      designer-base/src/main/java/com/fr/design/mainframe/JVirtualTemplate.java

2
designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java

@ -38,7 +38,7 @@ public class SwitchExistEnv extends MenuDef {
JTemplate<?, ?> t = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); JTemplate<?, ?> t = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (t != null) { if (t != null) {
GeneralContext.addEnvWillChangedListener( GeneralContext.addEnvWillChangedListener(
t.getFullPathName(), t.getPath(),
new EnvChangedListener() { new EnvChangedListener() {
public void envChanged() { public void envChanged() {
SwitchExistEnv.this.clearShortCuts(); SwitchExistEnv.this.clearShortCuts();

4
designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java

@ -105,7 +105,7 @@ public abstract class DesignTableDataManager {
public static void closeTemplate(JTemplate<?, ?> template) { public static void closeTemplate(JTemplate<?, ?> template) {
if (template != null) { if (template != null) {
dsListenersMap.remove(template.getFullPathName()); dsListenersMap.remove(template.getPath());
} }
} }
@ -164,7 +164,7 @@ public abstract class DesignTableDataManager {
JTemplate<?, ?> template = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); JTemplate<?, ?> template = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
String key = StringUtils.EMPTY; String key = StringUtils.EMPTY;
if (template != null) { if (template != null) {
key = template.getFullPathName(); key = template.getPath();
} }
List<ChangeListener> dsListeners = dsListenersMap.get(key); List<ChangeListener> dsListeners = dsListenersMap.get(key);
if (dsListeners == null) { if (dsListeners == null) {

10
designer-base/src/main/java/com/fr/design/file/HistoryTemplateListPane.java

@ -114,7 +114,7 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C
public void closeSelectedReport(JTemplate<?, ?> selected) { public void closeSelectedReport(JTemplate<?, ?> selected) {
DesignModuleFactory.clearChartPropertyPane(); DesignModuleFactory.clearChartPropertyPane();
DesignTableDataManager.closeTemplate(selected); DesignTableDataManager.closeTemplate(selected);
GeneralContext.removeEnvWillChangedListener(selected.getFullPathName()); GeneralContext.removeEnvWillChangedListener(selected.getPath());
if (contains(selected) == -1) { if (contains(selected) == -1) {
return; return;
} }
@ -139,7 +139,7 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C
public void closeVirtualSelectedReport(JTemplate<?, ?> selected) { public void closeVirtualSelectedReport(JTemplate<?, ?> selected) {
DesignModuleFactory.clearChartPropertyPane(); DesignModuleFactory.clearChartPropertyPane();
DesignTableDataManager.closeTemplate(selected); DesignTableDataManager.closeTemplate(selected);
GeneralContext.removeEnvWillChangedListener(selected.getFullPathName()); GeneralContext.removeEnvWillChangedListener(selected.getPath());
if (contains(selected) == -1) { if (contains(selected) == -1) {
return; return;
} }
@ -185,7 +185,7 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C
if (editingTemplate == null) { if (editingTemplate == null) {
return; return;
} }
DesignerEnvManager.getEnvManager().addRecentOpenedFilePath(editingTemplate.getFullPathName()); DesignerEnvManager.getEnvManager().addRecentOpenedFilePath(editingTemplate.getPath());
((HistoryListDataMode) list.getModel()).add(editingTemplate); ((HistoryListDataMode) list.getModel()).add(editingTemplate);
} }
@ -246,7 +246,7 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C
*/ */
public int contains(String filename) { public int contains(String filename) {
for (int i = 0; i < historyList.size(); i++) { for (int i = 0; i < historyList.size(); i++) {
String historyPath = historyList.get(i).getFullPathName(); String historyPath = historyList.get(i).getPath();
if (ComparatorUtils.equals(historyPath, filename)) { if (ComparatorUtils.equals(historyPath, filename)) {
return i; return i;
} }
@ -261,7 +261,7 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C
* @return 是则返回TRUE * @return 是则返回TRUE
*/ */
public boolean isCurrentEditingFile(String filename) { public boolean isCurrentEditingFile(String filename) {
String editingFileName = editingTemplate.getFullPathName(); String editingFileName = editingTemplate.getPath();
return ComparatorUtils.equals(filename, editingFileName); return ComparatorUtils.equals(filename, editingFileName);
} }

2
designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java

@ -218,7 +218,7 @@ public class TemplateTreePane extends JPanel implements FileOperations {
MutilTempalteTabPane.getInstance().setSelectedIndex(index - 1); MutilTempalteTabPane.getInstance().setSelectedIndex(index - 1);
} }
JTemplate selectedfile = MutilTempalteTabPane.getInstance().getSelectedFile(); JTemplate selectedfile = MutilTempalteTabPane.getInstance().getSelectedFile();
if (!HistoryTemplateListPane.getInstance().isCurrentEditingFile(selectedfile.getFullPathName())) { if (!HistoryTemplateListPane.getInstance().isCurrentEditingFile(selectedfile.getPath())) {
//如果此时面板上的实时刷新的selectedIndex得到的和历史的不一样 //如果此时面板上的实时刷新的selectedIndex得到的和历史的不一样
DesignerContext.getDesignerFrame().activateJTemplate(selectedfile); DesignerContext.getDesignerFrame().activateJTemplate(selectedfile);
} }

19
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -40,7 +40,6 @@ import com.fr.design.write.submit.DBManipulationInWidgetEventPane;
import com.fr.design.write.submit.DBManipulationPane; import com.fr.design.write.submit.DBManipulationPane;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.file.FILEChooserPane; import com.fr.file.FILEChooserPane;
import com.fr.file.FileNodeFILE;
import com.fr.file.MemFILE; import com.fr.file.MemFILE;
import com.fr.form.ui.NoneWidget; import com.fr.form.ui.NoneWidget;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
@ -50,17 +49,14 @@ import com.fr.log.FineLoggerFactory;
import com.fr.report.cell.Elem; import com.fr.report.cell.Elem;
import com.fr.report.cell.cellattr.CellImage; import com.fr.report.cell.cellattr.CellImage;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.OperatingSystem;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.core.UUID; import com.fr.stable.core.UUID;
import com.fr.stable.project.ProjectConstants;
import javax.swing.*; import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.undo.UndoManager; import javax.swing.undo.UndoManager;
import java.awt.*; import java.awt.*;
import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Set; import java.util.Set;
@ -202,16 +198,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
return -1; return -1;
} }
public String getFullPathName() { public String getPath() {
/*String editingFileName = getEditingFILE().getPath();
if (editingFileName.startsWith(ProjectConstants.REPORTLETS_NAME)) {
editingFileName = ((FileNodeFILE) getEditingFILE()).getEnvPath() + File.separator + editingFileName;
}
if (OperatingSystem.isWindows()) {
return editingFileName.replaceAll("/", "\\\\");
} else {
return editingFileName.replaceAll("\\\\", "/");
}*/
return getEditingFILE().getPath(); return getEditingFILE().getPath();
} }
@ -580,7 +567,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
* @return * @return
*/ */
public boolean saveAsTemplate(boolean isShowLoc, String fileName) { public boolean saveAsTemplate(boolean isShowLoc, String fileName) {
String oldName = this.getFullPathName(); String oldName = this.getPath();
// alex:如果是SaveAs的话需要让用户来选择路径了 // alex:如果是SaveAs的话需要让用户来选择路径了
FILEChooserPane fileChooser = getFILEChooserPane(isShowLoc); FILEChooserPane fileChooser = getFILEChooserPane(isShowLoc);
fileChooser.setFileNameTextField(fileName, this.suffix()); fileChooser.setFileNameTextField(fileName, this.suffix());
@ -619,7 +606,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
collectInfo(); collectInfo();
} }
//更换最近打开 //更换最近打开
DesignerEnvManager.getEnvManager().replaceRecentOpenedFilePath(oldName, this.getFullPathName()); DesignerEnvManager.getEnvManager().replaceRecentOpenedFilePath(oldName, this.getPath());
return result; return result;
} }

4
designer-base/src/main/java/com/fr/design/mainframe/JVirtualTemplate.java

@ -37,7 +37,7 @@ public class JVirtualTemplate extends JTemplate {
} }
@Override @Override
public String getFullPathName() { public String getPath() {
String editingFileName = getEditingFILE().getPath(); String editingFileName = getEditingFILE().getPath();
if (editingFileName.startsWith(ProjectConstants.REPORTLETS_NAME)) { if (editingFileName.startsWith(ProjectConstants.REPORTLETS_NAME)) {
editingFileName = ((FileNodeFILE) getEditingFILE()).getEnvPath() + File.separator + editingFileName; editingFileName = ((FileNodeFILE) getEditingFILE()).getEnvPath() + File.separator + editingFileName;
@ -258,7 +258,7 @@ public class JVirtualTemplate extends JTemplate {
@Override @Override
public Icon getIcon() { public Icon getIcon() {
if (getFullPathName().endsWith("cpt")) { if (getPath().endsWith("cpt")) {
return BaseUtils.readIcon("/com/fr/design/images/buttonicon/newcpts.png"); return BaseUtils.readIcon("/com/fr/design/images/buttonicon/newcpts.png");
} else { } else {
return BaseUtils.readIcon("/com/fr/web/images/form/new_form3.png"); return BaseUtils.readIcon("/com/fr/web/images/form/new_form3.png");

Loading…
Cancel
Save