Browse Source

REPORT-34994 移动端表格折叠树接口(单元格属性设置接口)-设计器部分

feature/big-screen
zack 4 years ago
parent
commit
6a8905f467
  1. 23
      designer-base/src/main/java/com/fr/design/cell/AbstractCellElementPropertyPane.java
  2. 34
      designer-base/src/main/java/com/fr/design/cell/CellElementPropertyComponent.java
  3. 2
      designer-base/src/main/java/com/fr/design/fun/CellAttributeProvider.java
  4. 18
      designer-base/src/main/java/com/fr/design/fun/CellPropertyPaneProvider.java
  5. 15
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractCellPropertyPaneProvider.java
  6. 6
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java
  7. 32
      designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java

23
designer-base/src/main/java/com/fr/design/cell/AbstractCellElementPropertyPane.java

@ -0,0 +1,23 @@
package com.fr.design.cell;
import com.fr.design.designer.TargetComponent;
import com.fr.design.dialog.BasicPane;
import javax.swing.JPanel;
/**
* @author zack
* @version 10.0
* Created by zack on 2020/7/14
*/
public abstract class AbstractCellElementPropertyPane extends BasicPane implements CellElementPropertyComponent {
@Override
public JPanel toPanel() {
return this;
}
@Override
public boolean accept(TargetComponent tc) {
return true;
}
}

34
designer-base/src/main/java/com/fr/design/cell/CellElementPropertyComponent.java

@ -0,0 +1,34 @@
package com.fr.design.cell;
import com.fr.design.designer.TargetComponent;
import javax.swing.JPanel;
/**
* 单元格属性配置面板接口
* @author zack
* @version 10.0
* Created by zack on 2020/7/14
*/
public interface CellElementPropertyComponent {
/**
* 判断当前编辑的对象是否显示当前实现
* @param tc
* @return
*/
boolean accept(TargetComponent tc);
/**
* 加载数据
* @param tc
*/
void populate(TargetComponent tc);
/**
* 返回当前属性面板,默认返回this
* @return
*/
JPanel toPanel();
}

2
designer-base/src/main/java/com/fr/design/fun/CellAttributeProvider.java

@ -4,8 +4,10 @@ import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.stable.fun.mark.Immutable;
/**
* 单元格属性面板扩展接口,接口基本逻辑不通且不符合接口设计规范,单元格属性扩展可以使用CellPropertyPaneProvider
* Created by zhouping on 2015/11/11.
*/
@Deprecated
public interface CellAttributeProvider extends Immutable{
String MARK_STRING = "CellAttributeProvider";

18
designer-base/src/main/java/com/fr/design/fun/CellPropertyPaneProvider.java

@ -0,0 +1,18 @@
package com.fr.design.fun;
import com.fr.design.cell.CellElementPropertyComponent;
/**
* 单元格设置(属性)扩展接口
* @author zack
* @version 10.0
* Created by zack on 2020/7/14
*/
public interface CellPropertyPaneProvider extends PropertyItemPaneProvider {
/**
* 构造单元格属性面板,面板实现需要使用单例模式实现
* @return 面板类
*/
CellElementPropertyComponent getSingletonCelPropertyPane();
}

15
designer-base/src/main/java/com/fr/design/fun/impl/AbstractCellPropertyPaneProvider.java

@ -0,0 +1,15 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.CellPropertyPaneProvider;
import com.fr.stable.fun.mark.API;
/**
* Created by zhouping on 2015/11/11.
*/
@API(level = CellPropertyPaneProvider.CURRENT_LEVEL)
public abstract class AbstractCellPropertyPaneProvider extends AbstractPropertyItemPaneProvider implements CellPropertyPaneProvider {
public int currentAPILevel() {
return CellPropertyPaneProvider.CURRENT_LEVEL;
}
}

6
designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

@ -219,8 +219,10 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
itemBean.getEnableModes());
UIButton button = propertyItem.getButton();
List<ActionListener> buttonListeners = itemBean.getButtonListeners();
for (ActionListener buttonListener : buttonListeners) {
button.addActionListener(buttonListener);
if (buttonListeners != null) {
for (ActionListener buttonListener : buttonListeners) {
button.addActionListener(buttonListener);
}
}
propertyItemMap.put(key, propertyItem);

32
designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java

@ -2,6 +2,7 @@ package com.fr.design.mainframe;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignState;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.cell.CellAttributeAction;
import com.fr.design.actions.cell.CellExpandAttrAction;
@ -18,7 +19,10 @@ import com.fr.design.actions.utils.DeprecatedActionManager;
import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.cell.CellElementPropertyComponent;
import com.fr.design.fun.CellPropertyPaneProvider;
import com.fr.design.fun.MenuHandler;
import com.fr.design.fun.PropertyItemPaneProvider;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.mainframe.cell.QuickEditorRegion;
import com.fr.design.menu.KeySetUtils;
@ -28,15 +32,17 @@ import com.fr.design.present.ConditionAttributesGroupPane;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.selection.SelectionEvent;
import com.fr.design.selection.SelectionListener;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.page.ReportSettingsProvider;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.ArrayUtils;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.util.Set;
/**
@ -82,6 +88,9 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
}
CellWidgetPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
//加载插件中的单元格属性
populateExtraCellProperties();
QuickEditorRegion.getInstance().populate(getCurrentEditor());
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
// 模板初始化完成后,才能初始化超级链接面板
@ -218,4 +227,25 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
return this.getTarget().getReportSettings();
}
private void populateExtraCellProperties() {
Selection selection = getSelection();
if (selection instanceof CellSelection) {
//单元格属性,限定下是选中单个单元格
TemplateElementCase elementCase = getEditingElementCase();
if (elementCase != null) {
Set<PropertyItemPaneProvider> itemPaneProviders = ExtraDesignClassManager.getInstance().getArray(PropertyItemPaneProvider.XML_TAG);
if (itemPaneProviders != null) {
for (PropertyItemPaneProvider itemPaneProvider : itemPaneProviders) {
if(itemPaneProvider instanceof CellPropertyPaneProvider){
CellPropertyPaneProvider cellPropertyPaneProvider = (CellPropertyPaneProvider) itemPaneProvider;
CellElementPropertyComponent cellElementPropertyPane = cellPropertyPaneProvider.getSingletonCelPropertyPane();
if (cellElementPropertyPane != null && cellElementPropertyPane.accept(ElementCasePaneDelegate.this)) {
cellElementPropertyPane.populate(ElementCasePaneDelegate.this);
}
}
}
}
}
}
}
}

Loading…
Cancel
Save