Browse Source

Merge pull request #1486 in DESIGN/design from ~HADES/design:release/10.0 to release/10.0

* commit '8de60f31418b6db2a3c40e0597bb3189ca3ed70f':
  REPORT-28026 && REPORT-27919
  fix
  REPORT-27771 && REPORT-27493 && REPORT-27954
feature/big-screen
Hades 5 years ago
parent
commit
2a983d2119
  1. 2
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java
  2. 11
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java
  3. 16
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  4. 9
      designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java
  5. 3
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  6. 30
      designer-realize/src/main/java/com/fr/design/actions/cell/NewPresentAction.java

2
designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java

@ -69,7 +69,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
} }
if (nameableList.getSelectedValue() instanceof ListModelElement) { if (nameableList.getSelectedValue() instanceof ListModelElement) {
Nameable selected = ((ListModelElement) nameableList.getSelectedValue()).wrapper; Nameable selected = ((ListModelElement) nameableList.getSelectedValue()).wrapper;
if (!ComparatorUtils.equals(tempName, selected.getName())) { if (!ComparatorUtils.equals(tempName, selected.getName()) && !isNameRepeated(new List[]{Arrays.asList(allDSNames), Arrays.asList(allListNames)}, tempName)) {
rename(selected.getName(), tempName); rename(selected.getName(), tempName);
} }

11
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/TableDataManagerPane.java

@ -33,9 +33,16 @@ public class TableDataManagerPane extends LoadingBasicPane {
); );
} }
tableDataPane = pane == null ? new TableDataPaneListPane() { tableDataPane = pane == null ? new TableDataPaneListPane() {
public void rename(String oldName, String newName) { @Override
public void rename(final String oldName, final String newName) {
super.rename(oldName, newName); super.rename(oldName, newName);
renameConnection(oldName, newName); new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() {
renameConnection(oldName, newName);
return null;
}
}.execute();
} }
} : pane; } : pane;
container.add(tableDataPane.getPanel(), BorderLayout.CENTER); container.add(tableDataPane.getPanel(), BorderLayout.CENTER);

16
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -684,21 +684,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
this.dispose(); this.dispose();
//模版重命名 //模版重命名
boolean success = false; boolean success = selectedOperation.rename(fnf, path, newPath);
// 提醒保存文件
SaveSomeTemplatePane saveSomeTempaltePane = new SaveSomeTemplatePane(true);
// 只有一个文件未保存时
if (HistoryTemplateListCache.getInstance().getHistoryCount() == 1) {
int choose = saveSomeTempaltePane.saveLastOneTemplate();
if (choose != JOptionPane.CANCEL_OPTION) {
success = selectedOperation.rename(fnf, path, newPath);
}
} else {
if (saveSomeTempaltePane.showSavePane()) {
success = selectedOperation.rename(fnf, path, newPath);
}
}
if (success) { if (success) {
HistoryTemplateListCache.getInstance().rename(fnf, path, newPath); HistoryTemplateListCache.getInstance().rename(fnf, path, newPath);

9
designer-base/src/main/java/com/fr/design/parameter/ParameterInputPane.java

@ -17,6 +17,7 @@ import com.fr.design.editor.editor.Editor;
import com.fr.design.editor.editor.FloatEditor; import com.fr.design.editor.editor.FloatEditor;
import com.fr.design.editor.editor.IntegerEditor; import com.fr.design.editor.editor.IntegerEditor;
import com.fr.design.editor.editor.TextEditor; import com.fr.design.editor.editor.TextEditor;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
@ -24,6 +25,8 @@ import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*; import java.awt.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
@ -103,6 +106,12 @@ public class ParameterInputPane extends BasicPane {
contentPane.add(flowTableLayoutHelper.createLabelFlowPane(parameterDisplayName + ":", editPane)); contentPane.add(flowTableLayoutHelper.createLabelFlowPane(parameterDisplayName + ":", editPane));
//add editor to parameter hashtable. //add editor to parameter hashtable.
textF.getCurrentEditor().addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().fireTargetModified();
}
});
this.editorNameMap.put(textF, parameter.getName()); this.editorNameMap.put(textF, parameter.getName());
nameAddedList.add(parameter.getName()); nameAddedList.add(parameter.getName());
} }

3
designer-form/src/main/java/com/fr/design/mainframe/JForm.java

@ -5,6 +5,7 @@ import com.fr.base.PaperSize;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.extension.FileExtension; import com.fr.base.extension.FileExtension;
import com.fr.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignState; import com.fr.design.DesignState;
import com.fr.design.actions.FormMobileAttrAction; import com.fr.design.actions.FormMobileAttrAction;
import com.fr.design.actions.TemplateParameterAction; import com.fr.design.actions.TemplateParameterAction;
@ -12,6 +13,7 @@ import com.fr.design.actions.core.WorkBookSupportable;
import com.fr.design.actions.file.export.EmbeddedFormExportExportAction; import com.fr.design.actions.file.export.EmbeddedFormExportExportAction;
import com.fr.design.base.mode.DesignModeContext; import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.cell.FloatElementsProvider; import com.fr.design.cell.FloatElementsProvider;
import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.designer.TargetComponent; import com.fr.design.designer.TargetComponent;
import com.fr.design.designer.beans.actions.CopyAction; import com.fr.design.designer.beans.actions.CopyAction;
import com.fr.design.designer.beans.actions.CutAction; import com.fr.design.designer.beans.actions.CutAction;
@ -587,6 +589,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
//下面这句话是防止撤销之后直接退出编辑再编辑撤销的东西会回来,因为撤销不会保存EC //下面这句话是防止撤销之后直接退出编辑再编辑撤销的东西会回来,因为撤销不会保存EC
formDesign.setElementCase(dataTable); formDesign.setElementCase(dataTable);
} }
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).refreshDockingView();
} catch (CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }

30
designer-realize/src/main/java/com/fr/design/actions/cell/NewPresentAction.java

@ -9,9 +9,13 @@ import com.fr.general.GeneralUtils;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection; import com.fr.grid.selection.Selection;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import java.awt.*;
public class NewPresentAction extends PresentCheckBoxAction { public class NewPresentAction extends PresentCheckBoxAction {
private String itemName = null; private String itemName = null;
@ -28,10 +32,28 @@ public class NewPresentAction extends PresentCheckBoxAction {
if (!ComparatorUtils.equals(this.itemName, "NOPRESENT")) { if (!ComparatorUtils.equals(this.itemName, "NOPRESENT")) {
CellElementPropertyPane.getInstance().GoToPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Present"), this.itemName); CellElementPropertyPane.getInstance().GoToPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Present"), this.itemName);
} else { } else {
TemplateCellElement ce = getSelectedCellElement(); ElementCasePane ePane = this.getEditingComponent();
// 只有原来ce设置了形态的情况下才有undo操作 TemplateElementCase elementCase = ePane.getEditingElementCase();
if (ce != null && ce.getPresent() != null) { Selection sel = ePane.getSelection();
ce.setPresent(null); if (sel instanceof CellSelection) {
CellSelection cs = (CellSelection) sel;
int cellRectangleCount = cs.getCellRectangleCount();
for (int rect = 0; rect < cellRectangleCount; rect++) {
Rectangle cellRectangle = cs.getCellRectangle(rect);
for (int j = 0; j < cellRectangle.height; j++) {
for (int i = 0; i < cellRectangle.width; i++) {
int column = i + cellRectangle.x;
int row = j + cellRectangle.y;
TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row);
if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(column, row);
elementCase.addCellElement(cellElement);
} else if (cellElement.getPresent() != null) {
cellElement.setPresent(null);
}
}
}
}
return true; return true;
} else { } else {
return false; return false;

Loading…
Cancel
Save