Browse Source

REPORT-9512 & REPORT-9297

master
Mata.Li 7 years ago
parent
commit
34874c6f52
  1. 21
      designer-base/src/com/fr/design/mainframe/DesignerFrame.java
  2. 30
      designer-realize/src/com/fr/design/mainframe/CellWidgetPropertyPane.java
  3. 6
      designer-realize/src/com/fr/design/widget/WidgetEventPane.java

21
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(); final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
//优先级为-1,保证最后全面刷新一次 //优先级为-1,保证最后全面刷新一次
GeneralContext.listenPluginRunningChanged(new PluginEventListener(-1) { GeneralContext.listenPluginRunningChanged(new PluginEventListener(-1) {
@Override @Override
public void on(PluginEvent event) { public void on(PluginEvent event) {
refreshNorthEastPane(northEastPane, ad); refreshNorthEastPane(northEastPane, ad);
DesignUtils.refreshDesignerFrame(); DesignUtils.refreshDesignerFrame();
} }
}, new PluginFilter() { }, new PluginFilter() {
@Override @Override
public boolean accept(PluginContext context) { public boolean accept(PluginContext context) {
return context.contain(PluginModule.ExtraDesign); return context.contain(PluginModule.ExtraDesign);
} }
}); });
@ -469,16 +469,16 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
// 下面的虚线 // 下面的虚线
downDottedLine = new DottedLine(UIScrollBar.HORIZONTAL, centerWidth); downDottedLine = new DottedLine(UIScrollBar.HORIZONTAL, centerWidth);
downDottedLine.setBounds(WestRegionContainerPane.getInstance().getContainerWidth(), contentHeight - 3, downDottedLine.setBounds(WestRegionContainerPane.getInstance().getContainerWidth(), contentHeight - 3,
centerWidth, 3); centerWidth, 3);
// 左边的虚线 // 左边的虚线
leftDottedLine = new DottedLine(UIScrollBar.VERTICAL, contentHeight - MENU_HEIGHT); leftDottedLine = new DottedLine(UIScrollBar.VERTICAL, contentHeight - MENU_HEIGHT);
leftDottedLine.setBounds(WestRegionContainerPane.getInstance().getContainerWidth(), MENU_HEIGHT, 3, leftDottedLine.setBounds(WestRegionContainerPane.getInstance().getContainerWidth(), MENU_HEIGHT, 3,
contentHeight - MENU_HEIGHT); contentHeight - MENU_HEIGHT);
rightDottedLine = new DottedLine(UIScrollBar.VERTICAL, contentHeight - MENU_HEIGHT); rightDottedLine = new DottedLine(UIScrollBar.VERTICAL, contentHeight - MENU_HEIGHT);
rightDottedLine.setBounds(contentWidth - EastRegionContainerPane.getInstance().getContainerWidth() - 3, 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(); String envName = DesignerEnvManager.getEnvManager().getCurEnvName();
Workspace workspace = WorkContext.getCurrent(); Workspace workspace = WorkContext.getCurrent();
DesignerWorkspaceInfo info = DesignerEnvManager.getEnvManager().getWorkspaceInfo(envName); 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) { if (editingTemplate != null) {
String path = editingTemplate.getEditingFILE().getPath(); String path = editingTemplate.getEditingFILE().getPath();
if (!editingTemplate.getEditingFILE().exists()) { if (!editingTemplate.getEditingFILE().exists()) {

30
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 CellSelection finalCS = (CellSelection) ePane.getSelection();
final TemplateElementCase tplEC = ePane.getEditingElementCase(); final TemplateElementCase tplEC = ePane.getEditingElementCase();
final Widget cellWidget = cellEditorDefPane.update(); 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(finalCS.isSelectedOneCell(ePane)){
if(tplEC.getTemplateCellElement(cellElement.getColumn(), cellElement.getRow())== null){//cellElement未加入到report中时要添加进去 if(tplEC.getTemplateCellElement(cellElement.getColumn(), cellElement.getRow())== null){//cellElement未加入到report中时要添加进去
tplEC.addCellElement(cellElement); tplEC.addCellElement(cellElement);

6
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.design.mainframe.JTemplate;
import com.fr.form.event.Listener; import com.fr.form.event.Listener;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.grid.selection.Selection;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject; import com.fr.general.NameObject;
@ -34,9 +35,12 @@ import javax.swing.*;
public class WidgetEventPane extends ObjectUIControlPane { public class WidgetEventPane extends ObjectUIControlPane {
private Selection selection;
public WidgetEventPane(ElementCasePane pane) { public WidgetEventPane(ElementCasePane pane) {
super(pane); super(pane);
this.setNameListEditable(false); this.setNameListEditable(false);
selection = pane.getSelection();
setBorder(BorderFactory.createEmptyBorder(10, 0, 15, 0)); setBorder(BorderFactory.createEmptyBorder(10, 0, 15, 0));
} }
@ -57,7 +61,7 @@ public class WidgetEventPane extends ObjectUIControlPane {
@Override @Override
public void saveSettings() { public void saveSettings() {
CellWidgetPropertyPane.getInstance().update(); CellWidgetPropertyPane.getInstance().update(selection);
} }
@Override @Override

Loading…
Cancel
Save