Browse Source

Merge pull request #202 in DESIGN/design from ~MATA.LI/designrel:release/10.0 to release/10.0

* commit '2b94751138d810caa781d200c93c397076de8226':
  REPORT-9512 & REPORT-9297
master
Mata.Li 6 years ago
parent
commit
c568c9d917
  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

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