Browse Source

代码质量

final/10.0
Hades 6 years ago
parent
commit
b38901e8b1
  1. 13
      designer-form/src/main/java/com/fr/design/designer/creator/XWScaleLayout.java
  2. 17
      designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java

13
designer-form/src/main/java/com/fr/design/designer/creator/XWScaleLayout.java

@ -10,6 +10,7 @@ import java.awt.event.ContainerEvent;
import com.fr.design.designer.beans.LayoutAdapter;
import com.fr.design.designer.beans.adapters.layout.FRScaleLayoutAdapter;
import com.fr.design.form.layout.FRScaleLayout;
import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WScaleLayout;
import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget;
@ -166,4 +167,16 @@ public class XWScaleLayout extends DedicateLayoutContainer {
XCreator child = getXCreator(INDEX);
child.firePropertyChange();
}
/**
* 获取被包装的XCreator扩展的属性tab
* @return
*/
@Override
public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() {
if (this.getXCreatorCount() > 0) {
return this.getXCreator(0).getWidgetPropertyUIProviders();
}
return super.getWidgetPropertyUIProviders();
}
}

17
designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java

@ -16,7 +16,6 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.widget.ui.FormWidgetCardPane;
import com.fr.design.widget.ui.designer.mobile.MobileWidgetDefinePane;
import com.fr.general.ComparatorUtils;
import com.fr.stable.ArrayUtils;
import javax.swing.*;
@ -174,26 +173,12 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
FormSelection selection = designer.getSelectionModel().getSelection();
WidgetPropertyUIProvider[] embeddedPropertyUIProviders = null;
if (selection != null && selection.getSelectedCreator() != null) {
embeddedPropertyUIProviders = getEmbeddedPropertyUIProviders(selection.getSelectedCreator());
embeddedPropertyUIProviders = selection.getSelectedCreator().getWidgetPropertyUIProviders();
}
Set<WidgetPropertyUIProvider> set = ExtraDesignClassManager.getInstance().getArray(WidgetPropertyUIProvider.XML_TAG);
return ArrayUtils.addAll(embeddedPropertyUIProviders, set.toArray(new WidgetPropertyUIProvider[set.size()]));
}
/**
* 获取当前控件扩展的属性tab
* @param xCreator
* @return
*/
private WidgetPropertyUIProvider[] getEmbeddedPropertyUIProviders(XCreator xCreator) {
if (xCreator instanceof XWScaleLayout
&& ComparatorUtils.equals(((XWScaleLayout) xCreator).getXCreatorCount(), 1)
&& ((XWScaleLayout) xCreator).getXCreator(0) instanceof XTextEditor) {
return ((XWScaleLayout) xCreator).getXCreator(0).getWidgetPropertyUIProviders();
}
return xCreator.getWidgetPropertyUIProviders();
}
/**
* 判断是将拓展的tab放入属性表还是将原来的tab放入属性表
*

Loading…
Cancel
Save