Browse Source

REPORT-3163 合作开发9.0设计器=>属性面板tab项动态变化(权限编辑)

master
plough 7 years ago
parent
commit
4525ae72c9
  1. 5
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  2. 5
      designer/src/com/fr/design/mainframe/JPolyWorkBook.java
  3. 7
      designer/src/com/fr/design/mainframe/JWorkBook.java
  4. 2
      designer_base/src/com/fr/design/actions/AllowAuthorityEditAction.java
  5. 1
      designer_base/src/com/fr/design/locale/designer.properties
  6. 1
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  7. 3
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  8. 3
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  9. 1
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  10. 1
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  11. 5
      designer_base/src/com/fr/design/mainframe/DesignerFrame.java
  12. 31
      designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java
  13. 3
      designer_base/src/com/fr/design/mainframe/JTemplate.java
  14. 2
      designer_base/src/com/fr/design/roleAuthority/RoleTree.java
  15. 4
      designer_form/src/com/fr/design/mainframe/JForm.java

5
designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java

@ -48,8 +48,9 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
if (BaseUtils.isAuthorityEditing()) {
AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(ElementCasePaneDelegate.this);
authorityPropertyPane.populate();
EastRegionContainerPane.getInstance().replaceUpPane(authorityPropertyPane);
EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance());
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane);
EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
return;
}

5
designer/src/com/fr/design/mainframe/JPolyWorkBook.java

@ -38,4 +38,9 @@ public class JPolyWorkBook extends JWorkBook {
public SheetNameTabPane createSheetNameTabPane(ReportComponentComposite reportCompositeX){
return new PolySheetNameTabPane(reportCompositeX);
}
@Override
public void refreshEastPropertiesPane() {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.POLY);
}
}

7
designer/src/com/fr/design/mainframe/JWorkBook.java

@ -102,6 +102,13 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
populateReportParameterAttr();
}
@Override
public void refreshEastPropertiesPane() {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT);
EastRegionContainerPane.getInstance().replaceCellElementPane(getEastUpPane());
EastRegionContainerPane.getInstance().replaceCellAttrPane(getEastDownPane());
}
@Override
protected UIModeControlContainer createCenterPane() {
parameterPane = ModuleContext.isModuleStarted(Module.FORM_MODULE) ? new ParameterDefinitePane() : null;

2
designer_base/src/com/fr/design/actions/AllowAuthorityEditAction.java

@ -1 +1 @@
package com.fr.design.actions; import com.fr.base.BaseUtils; import com.fr.design.constants.UIConstants; import com.fr.design.menu.KeySetUtils; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.designer.TargetComponent; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.*; /** * Author : daisy * Date: 13-8-30 * Time: 上午10:12 */ public class AllowAuthorityEditAction extends TemplateComponentAction { public AllowAuthorityEditAction(TargetComponent t) { super(t); this.setMenuKeySet(KeySetUtils.ALLOW_AUTHORITY_EDIT); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/allow_authority_edit.png")); } /** * 撤销 */ public void prepare4Undo() { HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().iniAuthorityUndoState(); } /** * 执行动作 * * @return 是否执行成功 */ public boolean executeActionReturnUndoRecordNeeded() { TargetComponent tc = getEditingComponent(); if (tc == null) { return false; } cleanAuthorityCondition(); //进入时是格式刷则取消格式刷 if (DesignerContext.getFormatState() != DesignerContext.FORMAT_STATE_NULL) { tc.cancelFormat(); } BaseUtils.setAuthorityEditing(true); ReportAndFSManagePane.getInstance().refreshDockingView(); RolesAlreadyEditedPane.getInstance().refreshDockingView(); WestRegionContainerPane.getInstance().replaceDownPane(ReportAndFSManagePane.getInstance()); DesignerContext.getDesignerFrame().setCloseMode(UIConstants.CLOSE_OF_AUTHORITY); DesignerContext.getDesignerFrame().resetToolkitByPlus(tc.getToolBarMenuDockPlus()); DesignerContext.getDesignerFrame().needToAddAuhtorityPaint(); EastRegionContainerPane.getInstance().replaceUpPane(tc.getEastUpPane()); DesignerContext.getDesignerFrame().refreshDottedLine(); EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().removeParameterPane(); //画虚线 return true; } /** * 进入权限编辑之前将权限编辑界面重置一下工具栏 */ private void cleanAuthorityCondition() { java.util.List<JTemplate<?, ?>> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); for (int i = 0; i < opendedTemplate.size(); i++) { opendedTemplate.get(i).cleanAuthorityUndo(); } } }
package com.fr.design.actions; import com.fr.base.BaseUtils; import com.fr.design.constants.UIConstants; import com.fr.design.menu.KeySetUtils; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.designer.TargetComponent; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.*; /** * Author : daisy * Date: 13-8-30 * Time: 上午10:12 */ public class AllowAuthorityEditAction extends TemplateComponentAction { public AllowAuthorityEditAction(TargetComponent t) { super(t); this.setMenuKeySet(KeySetUtils.ALLOW_AUTHORITY_EDIT); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/allow_authority_edit.png")); } /** * 撤销 */ public void prepare4Undo() { HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().iniAuthorityUndoState(); } /** * 执行动作 * * @return 是否执行成功 */ public boolean executeActionReturnUndoRecordNeeded() { TargetComponent tc = getEditingComponent(); if (tc == null) { return false; } cleanAuthorityCondition(); //进入时是格式刷则取消格式刷 if (DesignerContext.getFormatState() != DesignerContext.FORMAT_STATE_NULL) { tc.cancelFormat(); } BaseUtils.setAuthorityEditing(true); ReportAndFSManagePane.getInstance().refreshDockingView(); RolesAlreadyEditedPane.getInstance().refreshDockingView(); WestRegionContainerPane.getInstance().replaceDownPane(ReportAndFSManagePane.getInstance()); DesignerContext.getDesignerFrame().setCloseMode(UIConstants.CLOSE_OF_AUTHORITY); DesignerContext.getDesignerFrame().resetToolkitByPlus(tc.getToolBarMenuDockPlus()); DesignerContext.getDesignerFrame().needToAddAuhtorityPaint(); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION); EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(tc.getEastUpPane()); DesignerContext.getDesignerFrame().refreshDottedLine(); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().removeParameterPane(); //画虚线 return true; } /** * 进入权限编辑之前将权限编辑界面重置一下工具栏 */ private void cleanAuthorityCondition() { java.util.List<JTemplate<?, ?>> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); for (int i = 0; i < opendedTemplate.size(); i++) { opendedTemplate.get(i).cleanAuthorityUndo(); } } }

1
designer_base/src/com/fr/design/locale/designer.properties

@ -2010,3 +2010,4 @@ FR-Designer_Cell_Attributes=Cell Attributes
FR-Designer_Float_Element=Float Element
FR-Designer_Widget_Library=Widget Library
FR-Designer_No_Settings_Available=No Settings Available!
FR-Designer_Configured_Roles=Configured role

1
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -2010,3 +2010,4 @@ FR-Designer_Cell_Attributes=Cell Attributes
FR-Designer_Float_Element=Float Element
FR-Designer_Widget_Library=Widget Library
FR-Designer_No_Settings_Available=No Settings Available!
FR-Designer_Configured_Roles=Configured role

3
designer_base/src/com/fr/design/locale/designer_ja_JP.properties

@ -1986,4 +1986,5 @@ FR-Designer_Cell_Element=\u30BB\u30EB\u8981\u7D20
FR-Designer_Cell_Attributes=\u30BB\u30EB\u5C5E\u6027
FR-Designer_Float_Element=\u30D5\u30ED\u30FC\u30C8\u8981\u7D20
FR-Designer_Widget_Library=
FR-Designer_No_Settings_Available=
FR-Designer_No_Settings_Available=
FR-Designer_Configured_Roles=\u69CB\u6210\u3055\u308C\u305F\u5F79\u5272

3
designer_base/src/com/fr/design/locale/designer_ko_KR.properties

@ -1986,4 +1986,5 @@ FR-Designer_Cell_Element=\uC140\uC694\uC18C
FR-Designer_Cell_Attributes=\uC140\uC18D\uC131
FR-Designer_Float_Element=\uD638\uBC84\uC694\uC18C
FR-Designer_Widget_Library=
FR-Designer_No_Settings_Available=
FR-Designer_No_Settings_Available=
FR-Designer_Configured_Roles=\uC5ED\uD560\uC774\uAD6C\uC131\uB418\uC5C8\uC2B5\uB2C8\uB2E4.

1
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -2008,3 +2008,4 @@ FR-Designer_Cell_Attributes=\u5355\u5143\u683C\u5C5E\u6027
FR-Designer_Float_Element=\u60AC\u6D6E\u5143\u7D20
FR-Designer_Widget_Library=\u7EC4\u4EF6\u5E93
FR-Designer_No_Settings_Available=\u65E0\u53EF\u7528\u914D\u7F6E\u9879\uFF01
FR-Designer_Configured_Roles=\u5DF2\u914D\u7F6E\u89D2\u8272

1
designer_base/src/com/fr/design/locale/designer_zh_TW.properties

@ -2009,3 +2009,4 @@ FR-Designer_Cell_Attributes=\u5132\u5B58\u683C\u5C6C\u6027
FR-Designer_Float_Element=\u61F8\u6D6E\u5143\u7D20
FR-Designer_Widget_Library=\u7D44\u4EF6\u5EAB
FR-Designer_No_Settings_Available=\u7121\u53EF\u7528\u914D\u5BD8\u9805\uFF01
FR-Designer_Configured_Roles=\u5DF2\u914D\u7F6E\u89D2\u8272

5
designer_base/src/com/fr/design/mainframe/DesignerFrame.java

@ -421,10 +421,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
BaseUtils.setAuthorityEditing(false);
WestRegionContainerPane.getInstance().replaceDownPane(
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
EastRegionContainerPane.getInstance().replaceUpPane(
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getEastUpPane());
EastRegionContainerPane.getInstance().replaceDownPane(
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getEastDownPane());
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane();
DesignerContext.getDesignerFrame().resetToolkitByPlus(
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getToolBarMenuDockPlus());
needToAddAuhtorityPaint();

31
designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java

@ -35,6 +35,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private static final String KEY_CONDITION_ATTR = "conditionAttr";
private static final String KEY_HYPERLINK = "hyperlink";
private static final String KEY_WIDGET_LIB = "widgetLib";
private static final String KEY_AUTHORITY_EDITION = "authorityEdition";
private static final String KEY_CONFIGURED_ROLES = "editedRoles";
private static final String DEFAULT_PANE = "defaultPane"; // "无可用配置项"面板
public enum PropertyMode {
@ -45,7 +47,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
FORM_REPORT, // 表单报表块
POLY, // 聚合报表
POLY_REPORT, // 聚合报表-报表块
POLY_CHART // 聚合报表-图表块
POLY_CHART, // 聚合报表-图表块
AUTHORITY_EDITION // 权限编辑
}
private PropertyMode currentMode; // 当前模式(根据不同模式,显示不同的可用面板)
@ -104,6 +107,14 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
PropertyItem widgetLib = new PropertyItem(KEY_WIDGET_LIB, Inter.getLocText("FR-Designer_Widget_Library"),
"/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.FORM},
new PropertyMode[]{PropertyMode.FORM});
// 权限编辑
PropertyItem authorityEdition = new PropertyItem(KEY_AUTHORITY_EDITION, Inter.getLocText("FR-Designer_Permissions_Edition"),
"/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.AUTHORITY_EDITION},
new PropertyMode[]{PropertyMode.AUTHORITY_EDITION});
// 已配置角色
PropertyItem configuredRoles = new PropertyItem(KEY_CONFIGURED_ROLES, Inter.getLocText("FR-Designer_Configured_Roles"),
"/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.AUTHORITY_EDITION},
new PropertyMode[]{PropertyMode.AUTHORITY_EDITION});
propertyItemMap.put(KEY_CELL_ELEMENT, cellElement);
propertyItemMap.put(KEY_CELL_ATTR, cellAttr);
@ -112,6 +123,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
propertyItemMap.put(KEY_CONDITION_ATTR, conditionAttr);
propertyItemMap.put(KEY_HYPERLINK, hyperlink);
propertyItemMap.put(KEY_WIDGET_LIB, widgetLib);
propertyItemMap.put(KEY_AUTHORITY_EDITION, authorityEdition);
propertyItemMap.put(KEY_CONFIGURED_ROLES, configuredRoles);
}
// "无可用配置项"面板
@ -258,6 +271,22 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
return propertyItemMap.get(KEY_WIDGET_LIB).getContentPane();
}
public void replaceAuthorityEditionPane(JComponent pane) {
propertyItemMap.get(KEY_AUTHORITY_EDITION).replaceContentPane(pane);
}
public JComponent getAuthorityEditionPane() {
return propertyItemMap.get(KEY_AUTHORITY_EDITION).getContentPane();
}
public void replaceConfiguredRolesPane(JComponent pane) {
propertyItemMap.get(KEY_CONFIGURED_ROLES).replaceContentPane(pane);
}
public JComponent getConfiguredRolesPane() {
return propertyItemMap.get(KEY_CONFIGURED_ROLES).getContentPane();
}
public void addParameterPane(JComponent paraPane) {
// propertyItemMap.get(KEY_HYPERLINK).replaceContentPane(paraPane);
}

3
designer_base/src/com/fr/design/mainframe/JTemplate.java

@ -109,6 +109,9 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
}
}
// 刷新右侧属性面板
public abstract void refreshEastPropertiesPane();
// 为收集模版信息作准备
private void initForCollect() {
template.initTemplateID(); // 为新模板设置 templateID 属性

2
designer_base/src/com/fr/design/roleAuthority/RoleTree.java

File diff suppressed because one or more lines are too long

4
designer_form/src/com/fr/design/mainframe/JForm.java

@ -88,6 +88,10 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
super(form, file);
}
@Override
public void refreshEastPropertiesPane() {
}
public int getMenuState() {
return DesignState.JFORM;

Loading…
Cancel
Save