Browse Source

add interface

master
frharry 8 years ago
parent
commit
1eddab8678
  1. 20
      designer/src/com/fr/design/webattr/EditToolBar.java
  2. 44
      designer_base/src/com/fr/design/fun/ExtraButtonToolBarProvider.java
  3. 19
      designer_base/src/com/fr/design/fun/impl/AbstractExtraButtonToolBarProvider.java

20
designer/src/com/fr/design/webattr/EditToolBar.java

@ -7,6 +7,7 @@ import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.fun.ExportToolBarProvider;
import com.fr.design.fun.ExtraButtonToolBarProvider;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
@ -29,6 +30,7 @@ import com.fr.form.ui.Widget;
import com.fr.form.ui.WidgetManager;
import com.fr.general.Background;
import com.fr.general.Inter;
import com.fr.plugin.weixin.send.SendWeixinButton;
import com.fr.report.web.button.Export;
import com.fr.report.web.button.PDFPrint;
import com.fr.report.web.button.Print;
@ -328,6 +330,8 @@ public class EditToolBar extends BasicPane {
private JavaScriptActionPane javaScriptPane;
private ExportToolBarProvider[] exportToolBarProviders;
private ExtraButtonToolBarProvider[] extraButtonToolBarProviders;
private ChangeListener changeListener = new ChangeListener() {
public void stateChanged(ChangeEvent e) {
if (isVerify.isSelected()) {
@ -386,6 +390,12 @@ public class EditToolBar extends BasicPane {
centerPane.add(getCpane(), "appendcount");
centerPane.add(getSubmitPane(), "submit");
Set<ExtraButtonToolBarProvider> extraButtonSet = ExtraDesignClassManager.getInstance().getArray(ExtraButtonToolBarProvider.XML_TAG);
extraButtonToolBarProviders = extraButtonSet.toArray(new ExtraButtonToolBarProvider[set.size()]);
for(int i=0; i<ArrayUtils.getLength(extraButtonToolBarProviders); i++){
extraButtonToolBarProviders[i].updateCenterPane(centerPane);
}
this.add(centerPane, BorderLayout.CENTER);
}
@ -479,7 +489,6 @@ public class EditToolBar extends BasicPane {
return submitPane;
}
@Override
protected String title4PopupWindow() {
return "Button";
@ -528,6 +537,10 @@ public class EditToolBar extends BasicPane {
} else if (widget instanceof CustomToolBarButton) {
populateCustomToolBarButton();
}
for(int i=0; i<ArrayUtils.getLength(extraButtonToolBarProviders); i++){
extraButtonToolBarProviders[i].populate(widget, card, centerPane);
}
}
private void populateAppendColumnRow(){
@ -613,6 +626,11 @@ public class EditToolBar extends BasicPane {
if (widget instanceof Button) {
updateDefault();
}
for(int i=0; i<ArrayUtils.getLength(extraButtonToolBarProviders); i++){
extraButtonToolBarProviders[i].update(widget);
}
return widget;
}

44
designer_base/src/com/fr/design/fun/ExtraButtonToolBarProvider.java

@ -0,0 +1,44 @@
package com.fr.design.fun;
import com.fr.form.ui.Widget;
import com.fr.stable.fun.mark.Mutable;
import javax.swing.*;
import java.awt.*;
/**
* 报表工具栏设计器端拓展用于配置按钮额外属性
*
* Created by harry on 2016-12-23.
*/
public interface ExtraButtonToolBarProvider extends Mutable {
String XML_TAG = "ButtonToolBarProvider";
int CURRENT_LEVEL = 1;
/**
*
* 用于添加属性面板
*
* @param centerPane 面板
*/
void updateCenterPane(JPanel centerPane);
/**
*
* 更新界面
*
* @param widget 控件
* @param card 卡片布局
* @param centerPane 面板
*/
void populate(Widget widget, CardLayout card, JPanel centerPane);
/**
* 保存界面设置
*
* @param widget 控件
*/
void update(Widget widget);
}

19
designer_base/src/com/fr/design/fun/impl/AbstractExtraButtonToolBarProvider.java

@ -0,0 +1,19 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.ExtraButtonToolBarProvider;
import com.fr.stable.fun.impl.AbstractProvider;
import com.fr.stable.fun.mark.API;
/**
* Created by harry on 2016-12-23.
*/
@API(level = ExtraButtonToolBarProvider.CURRENT_LEVEL)
public abstract class AbstractExtraButtonToolBarProvider extends AbstractProvider implements ExtraButtonToolBarProvider {
public int currentAPILevel() {
return ExtraButtonToolBarProvider.CURRENT_LEVEL;
}
public String mark4Provider() {
return getClass().getName();
}
}
Loading…
Cancel
Save