Browse Source

REPORT-9512 & REPORT-9297

master
Mata.Li 7 years ago
parent
commit
34874c6f52
  1. 7
      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

7
designer-base/src/com/fr/design/mainframe/DesignerFrame.java

@ -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

@ -131,6 +131,36 @@ public class CellWidgetPropertyPane extends BasicPane {
} }
} }
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);
}
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();
}
}
private void setCellWidget(Widget cellWidget, TemplateCellElement cellElement){ private void setCellWidget(Widget cellWidget, TemplateCellElement cellElement){
if (cellWidget instanceof NoneWidget) { if (cellWidget instanceof NoneWidget) {
cellElement.setWidget(null); cellElement.setWidget(null);

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