Browse Source

Pull request #5493: REPORT-54538 REPORT-57590 bug fixed

Merge in DESIGN/design from ~TOMMY/design:release/10.0 to release/10.0

* commit '04bac5d214bddc2ff1d1febdfdc1c0a79e8dcad8':
  REPORT-57590 表单参数面板不应该能被复制到容器内
  REPORT-54538 组件复用无网络提示地址支持选中复制
zheng-1641779399395
Tommy 3 years ago
parent
commit
db6de26374
  1. 10
      designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java
  2. 27
      designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java
  3. 10
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java

10
designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java

@ -103,6 +103,16 @@ public class XWParameterLayout extends XWAbsoluteLayout {
return false;
}
@Override
public boolean canEnterIntoAbsolutePane() {
return false;
}
@Override
public boolean canEnterIntoAdaptPane() {
return false;
}
/**
* 该组件是否可以拖拽(表单中参数面板和自适应布局不可以拖拽)
* @return 是则返回true

27
designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java

@ -10,6 +10,7 @@ import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWAbsoluteLayout;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.creator.XWScaleLayout;
import com.fr.design.designer.creator.XWTitleLayout;
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout;
@ -60,6 +61,11 @@ public class FormSelectionUtils {
*/
public static void paste2Container(FormDesigner designer, XLayoutContainer parent,
FormSelection clipboard, int x, int y) {
clipboard = filterFormSelection(clipboard, parent);
if (clipboard.isEmpty()) {
Toolkit.getDefaultToolkit().beep();
return;
}
LayoutAdapter adapter = parent.getLayoutAdapter();
if (parent instanceof XWAbsoluteLayout) {
//绝对布局
@ -77,6 +83,27 @@ public class FormSelectionUtils {
Toolkit.getDefaultToolkit().beep();
}
private static FormSelection filterFormSelection(FormSelection clipboard, XLayoutContainer parent) {
FormSelection newSelection = new FormSelection();
for (XCreator xCreator : clipboard.getSelectedCreators()) {
if (parent.acceptType(XWParameterLayout.class)) {
if (xCreator.canEnterIntoParaPane()) {
newSelection.addSelectedCreator(xCreator);
}
} else if (parent.acceptType(XWAbsoluteLayout.class)) {
if (xCreator.canEnterIntoAbsolutePane()) {
newSelection.addSelectedCreator(xCreator);
}
} else if (parent.acceptType(XWFitLayout.class)) {
if (xCreator.canEnterIntoAdaptPane()) {
newSelection.addSelectedCreator(xCreator);
}
}
}
return newSelection;
}
private static boolean isExtraContainer(XLayoutContainer parent) {
if (parent != null) {
Set<FormWidgetOptionProvider> set = ExtraDesignClassManager.getInstance().getArray(FormWidgetOptionProvider.XML_TAG);

10
designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java

@ -14,6 +14,7 @@ import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.SwingWorker;
import java.awt.BorderLayout;
@ -164,9 +165,14 @@ public class OnlineWidgetRepoPane extends BasicPane {
tipLabel1.setForeground(Color.decode("#8F8F92"));
UILabel tipLabel2 = tipLabel(Toolkit.i18nText("Fine-Design_Share_Internet_Connect_Failed_Tip2"));
tipLabel2.setForeground(Color.decode("#8F8F92"));
UILabel tipLabel3 = tipLabel(MARKET_URL);
tipLabel3.setForeground(Color.decode("#8F8F92"));
JTextField tipLabel3 = new JTextField(MARKET_URL);
tipLabel3.setHorizontalAlignment(JTextField.CENTER);
tipLabel3.setPreferredSize(new Dimension(240, 20));
tipLabel3.setEditable(false);
tipLabel3.setForeground(Color.decode("#8F8F92"));
tipLabel3.setBackground(null);
tipLabel3.setBorder(null);
UILabel emptyLabel = tipLabel(StringUtils.EMPTY);
panel.add(uiLabel);

Loading…
Cancel
Save