Browse Source

Merge branch 'release/11.0' of ssh://code.fineres.com:7999/~kerry/design_10.0 into release/11.0

bugfix/11.0
kerry 3 years ago
parent
commit
f88fa9c1c5
  1. 26
      designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java
  2. 11
      designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java
  3. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java
  4. 10
      designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java

26
designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java

@ -71,6 +71,7 @@ import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout;
import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.form.ui.container.cardlayout.WCardTagLayout;
import com.fr.form.ui.container.cardlayout.WCardTitleLayout; import com.fr.form.ui.container.cardlayout.WCardTitleLayout;
import com.fr.form.ui.container.cardlayout.WTabFitLayout; import com.fr.form.ui.container.cardlayout.WTabFitLayout;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.invoke.Reflect; import com.fr.invoke.Reflect;
@ -82,6 +83,7 @@ import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventListener;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.third.javax.annotation.Nonnull; import com.fr.third.javax.annotation.Nonnull;
import java.util.Set;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import javax.swing.Icon; import javax.swing.Icon;
@ -446,4 +448,28 @@ public class XCreatorUtils {
return xCreator; return xCreator;
} }
public static boolean isExtraContainer(XCreator creator) {
Set<FormWidgetOptionProvider> set = ExtraDesignClassManager.getInstance().getArray(FormWidgetOptionProvider.XML_TAG);
for (FormWidgetOptionProvider provider : set) {
if (provider.isContainer()
&& ComparatorUtils.equals(provider.appearanceForWidget(), provider.appearanceForWidget())
&& ComparatorUtils.equals(provider.classForWidget(), creator.toData().getClass())) {
return true;
}
}
return false;
}
public static XLayoutContainer getParent(XCreator source) {
if (source.acceptType(XWCardTagLayout.class) ) {
return (XLayoutContainer)source.getParent();
}
XLayoutContainer container = XCreatorUtils.getParentXLayoutContainer(source);
boolean accept = (source.acceptType(XWFitLayout.class) || source.acceptType(XWParameterLayout.class)) && !isExtraContainer(source);
if (accept) {
container = null;
}
return container;
}
} }

11
designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java

@ -7,6 +7,7 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEditListener;
import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.fun.FormWidgetOptionProvider; import com.fr.design.fun.FormWidgetOptionProvider;
import com.fr.design.gui.chart.ChartXMLTag; import com.fr.design.gui.chart.ChartXMLTag;
import com.fr.design.gui.core.FormWidgetOption; import com.fr.design.gui.core.FormWidgetOption;
@ -18,6 +19,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.module.DesignModuleFactory; import com.fr.design.module.DesignModuleFactory;
import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.UserDefinedWidgetConfig; import com.fr.form.ui.UserDefinedWidgetConfig;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
@ -98,6 +100,15 @@ public class FormParaWidgetPane extends JPanel {
synchronized (FormParaWidgetPane.class) { synchronized (FormParaWidgetPane.class) {
THIS = null; THIS = null;
} }
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
JTemplate<?, ?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (template != null && !template.isJWorkBook()) {
DesignerContext.getDesignerFrame().resetToolkitByPlus(template);
}
}
});
} }
}, new PluginFilter() { }, new PluginFilter() {

7
designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java

@ -65,12 +65,9 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
initDefinePane(); initDefinePane();
} }
@Deprecated
public XLayoutContainer getParent(XCreator source) { public XLayoutContainer getParent(XCreator source) {
XLayoutContainer container = XCreatorUtils.getParentXLayoutContainer(source); return XCreatorUtils.getParent(source);
if (source.acceptType(XWFitLayout.class) || source.acceptType(XWParameterLayout.class)) {
container = null;
}
return container;
} }
public WidgetBoundPane createWidgetBoundPane(XCreator xCreator) { public WidgetBoundPane createWidgetBoundPane(XCreator xCreator) {

10
designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java

@ -61,15 +61,9 @@ public class WidgetBoundPane extends BasicPane {
initBoundPane(); initBoundPane();
} }
@Deprecated
public XLayoutContainer getParent(XCreator source) { public XLayoutContainer getParent(XCreator source) {
if(source.acceptType(XWCardTagLayout.class)){ return XCreatorUtils.getParent(source);
return (XLayoutContainer)source.getParent();
}
XLayoutContainer container = XCreatorUtils.getParentXLayoutContainer(source);
if (source.acceptType(XWFitLayout.class) || source.acceptType(XWParameterLayout.class)) {
container = null;
}
return container;
} }
public void initBoundPane() { public void initBoundPane() {

Loading…
Cancel
Save