Browse Source

Merge pull request #275 in DESIGN/design from ~ZACK/design:release/10.0 to release/10.0

* commit '7c107796d6d01e15d9b551d483fba2238a49ffaa':
  代码质量
  REPORT-10055 【10.0控件】安装缩进比例控制控件后无效插件不能即时生效
research/10.0
zack 6 years ago
parent
commit
b04ed467e9
  1. 44
      designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java
  2. 24
      designer-realize/src/main/java/com/fr/design/condition/PaddingPane.java

44
designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java

@ -20,15 +20,27 @@ import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.event.EventDispatcher;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.ExtraClassManager;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.observer.PluginEventType;
import com.fr.report.fun.VerticalTextProcessor;
import com.fr.report.fun.impl.DefaultVerticalTextProcessor;
import com.fr.stable.Constants;
import javax.swing.*;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
@ -103,12 +115,32 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO
initOtherComponent();
initAllNames();
indentationUnitProcessor = ExtraDesignClassManager.getInstance().getSingle(IndentationUnitProcessor.MARK_STRING);
if (null == indentationUnitProcessor) {
indentationUnitProcessor = new DefaultIndentationUnitProcessor();
addPluginListeners(PluginEventType.AfterRun);
addPluginListeners(PluginEventType.AfterStop);
refreshIndentationUnit();
}
private void addPluginListeners(PluginEventType type) {
EventDispatcher.listen(type, new PluginEventListener() {
@Override
public void on(PluginEvent event) {
refreshIndentationUnit();
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(IndentationUnitProcessor.MARK_STRING);
}
});
}
private void refreshIndentationUnit() {
this.indentationUnitProcessor = ExtraDesignClassManager.getInstance().getSingle(IndentationUnitProcessor.MARK_STRING);
if (null == this.indentationUnitProcessor) {
this.indentationUnitProcessor = new DefaultIndentationUnitProcessor();
}
}
private void initOtherComponent() {
hPaneContainer.add(hAlignmentPane);

24
designer-realize/src/main/java/com/fr/design/condition/PaddingPane.java

@ -7,11 +7,15 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.style.DefaultIndentationUnitProcessor;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.GeneralContext;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.report.cell.cellattr.highlight.HighlightAction;
import com.fr.report.cell.cellattr.highlight.PaddingHighlightAction;
import javax.swing.*;
import javax.swing.SpinnerNumberModel;
/**
* @author richie
@ -45,7 +49,23 @@ public class PaddingPane extends ConditionAttrSingleConditionPane<HighlightActio
this.add(this.paddingScopeComboBox);
this.paddingLeftSpinner.setValue(new Integer(0));
this.paddingRightSpinner.setValue(new Integer(0));
GeneralContext.listenPluginRunningChanged(new PluginEventListener() {
@Override
public void on(PluginEvent event) {
refreshIndentationUnit();
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(IndentationUnitProcessor.MARK_STRING);
}
});
refreshIndentationUnit();
}
private void refreshIndentationUnit() {
this.indentationUnitProcessor = ExtraDesignClassManager.getInstance().getSingle(IndentationUnitProcessor.MARK_STRING);
if (null == this.indentationUnitProcessor) {
this.indentationUnitProcessor = new DefaultIndentationUnitProcessor();

Loading…
Cancel
Save