From 34874c6f522284a933de99b15c2a4acfcc85ef0e Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Mon, 9 Jul 2018 18:57:29 +0800 Subject: [PATCH] REPORT-9512 & REPORT-9297 --- .../fr/design/mainframe/DesignerFrame.java | 21 ++++++++----- .../mainframe/CellWidgetPropertyPane.java | 30 +++++++++++++++++++ .../com/fr/design/widget/WidgetEventPane.java | 6 +++- 3 files changed, 48 insertions(+), 9 deletions(-) diff --git a/designer-base/src/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/com/fr/design/mainframe/DesignerFrame.java index be8aa97bf..3636a18da 100644 --- a/designer-base/src/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/com/fr/design/mainframe/DesignerFrame.java @@ -375,18 +375,18 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); //优先级为-1,保证最后全面刷新一次 GeneralContext.listenPluginRunningChanged(new PluginEventListener(-1) { - + @Override public void on(PluginEvent event) { - + refreshNorthEastPane(northEastPane, ad); DesignUtils.refreshDesignerFrame(); } }, new PluginFilter() { - + @Override public boolean accept(PluginContext context) { - + return context.contain(PluginModule.ExtraDesign); } }); @@ -469,16 +469,16 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta // 下面的虚线 downDottedLine = new DottedLine(UIScrollBar.HORIZONTAL, centerWidth); downDottedLine.setBounds(WestRegionContainerPane.getInstance().getContainerWidth(), contentHeight - 3, - centerWidth, 3); + centerWidth, 3); // 左边的虚线 leftDottedLine = new DottedLine(UIScrollBar.VERTICAL, contentHeight - MENU_HEIGHT); leftDottedLine.setBounds(WestRegionContainerPane.getInstance().getContainerWidth(), MENU_HEIGHT, 3, - contentHeight - MENU_HEIGHT); + contentHeight - MENU_HEIGHT); rightDottedLine = new DottedLine(UIScrollBar.VERTICAL, contentHeight - MENU_HEIGHT); rightDottedLine.setBounds(contentWidth - EastRegionContainerPane.getInstance().getContainerWidth() - 3, - MENU_HEIGHT, 3, contentHeight - MENU_HEIGHT); + MENU_HEIGHT, 3, contentHeight - MENU_HEIGHT); } @@ -719,7 +719,12 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta String envName = DesignerEnvManager.getEnvManager().getCurEnvName(); Workspace workspace = WorkContext.getCurrent(); DesignerWorkspaceInfo info = DesignerEnvManager.getEnvManager().getWorkspaceInfo(envName); - defaultTitleSB.append(info.getName()).append("@").append(envName).append("[").append(workspace.getDescription()).append("]"); + + String username = null; + if (info != null){ + username = info.getName(); + } + defaultTitleSB.append(username).append("@").append(envName).append("[").append(workspace.getDescription()).append("]"); if (editingTemplate != null) { String path = editingTemplate.getEditingFILE().getPath(); if (!editingTemplate.getEditingFILE().exists()) { diff --git a/designer-realize/src/com/fr/design/mainframe/CellWidgetPropertyPane.java b/designer-realize/src/com/fr/design/mainframe/CellWidgetPropertyPane.java index 2da57a7a7..6fcc2e656 100644 --- a/designer-realize/src/com/fr/design/mainframe/CellWidgetPropertyPane.java +++ b/designer-realize/src/com/fr/design/mainframe/CellWidgetPropertyPane.java @@ -108,6 +108,36 @@ public class CellWidgetPropertyPane extends BasicPane { final CellSelection finalCS = (CellSelection) ePane.getSelection(); final TemplateElementCase tplEC = ePane.getEditingElementCase(); final Widget cellWidget = cellEditorDefPane.update(); + if (finalCS.isSelectedOneCell(ePane)) { + if (tplEC.getTemplateCellElement(cellElement.getColumn(), cellElement.getRow()) == null) {//cellElement未加入到report中时要添加进去 + tplEC.addCellElement(cellElement); + } + setCellWidget(cellWidget, cellElement); + } else { + ReportActionUtils.actionIterateWithCellSelection(finalCS, tplEC, new ReportActionUtils.IterAction() { + public void dealWith(CellElement editCellElement) { + // p:最后把这个cellEditorDef设置到CellGUIAttr. + TemplateCellElement templateCellElement = (TemplateCellElement) editCellElement; + try { + setCellWidget((Widget) cellWidget.clone(), templateCellElement); + } catch (CloneNotSupportedException e) { + FRContext.getLogger().error("InternalError: " + e.getMessage()); + } + } + }); + } + if (DesignerContext.getDesignerFrame().getSelectedJTemplate() != null) { + DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified(); + } + } + + public void update(Selection selection) { + if (cellElement == null || !cellEditorDefPane.isShouldFireSelectedEvent()) { + return; + } + final CellSelection finalCS = (CellSelection) selection; + final TemplateElementCase tplEC = ePane.getEditingElementCase(); + final Widget cellWidget = cellEditorDefPane.update(); if(finalCS.isSelectedOneCell(ePane)){ if(tplEC.getTemplateCellElement(cellElement.getColumn(), cellElement.getRow())== null){//cellElement未加入到report中时要添加进去 tplEC.addCellElement(cellElement); diff --git a/designer-realize/src/com/fr/design/widget/WidgetEventPane.java b/designer-realize/src/com/fr/design/widget/WidgetEventPane.java index b840876d9..2e445fe0b 100644 --- a/designer-realize/src/com/fr/design/widget/WidgetEventPane.java +++ b/designer-realize/src/com/fr/design/widget/WidgetEventPane.java @@ -18,6 +18,7 @@ import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.JTemplate; import com.fr.form.event.Listener; import com.fr.form.ui.Widget; +import com.fr.grid.selection.Selection; import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.general.NameObject; @@ -34,9 +35,12 @@ import javax.swing.*; public class WidgetEventPane extends ObjectUIControlPane { + private Selection selection; + public WidgetEventPane(ElementCasePane pane) { super(pane); this.setNameListEditable(false); + selection = pane.getSelection(); setBorder(BorderFactory.createEmptyBorder(10, 0, 15, 0)); } @@ -57,7 +61,7 @@ public class WidgetEventPane extends ObjectUIControlPane { @Override public void saveSettings() { - CellWidgetPropertyPane.getInstance().update(); + CellWidgetPropertyPane.getInstance().update(selection); } @Override