Browse Source

bug103155,tab布局的重命名功能先屏蔽了

master
zack 8 years ago
parent
commit
52af1da903
  1. 36
      designer_form/src/com/fr/design/designer/beans/adapters/component/CompositeComponentAdapter.java
  2. 9
      designer_form/src/com/fr/design/designer/creator/XCreator.java
  3. 30
      designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java

36
designer_form/src/com/fr/design/designer/beans/adapters/component/CompositeComponentAdapter.java

@ -1,38 +1,31 @@
package com.fr.design.designer.beans.adapters.component; package com.fr.design.designer.beans.adapters.component;
import java.awt.AlphaComposite;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.MouseEvent;
import java.beans.IntrospectionException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import javax.swing.Action;
import javax.swing.JComponent;
import javax.swing.JPopupMenu;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.beans.GroupModel; import com.fr.design.beans.GroupModel;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.gui.xtable.PropertyGroupModel;
import com.fr.design.designer.beans.ComponentAdapter; import com.fr.design.designer.beans.ComponentAdapter;
import com.fr.design.designer.beans.actions.ChangeNameAction; import com.fr.design.designer.beans.actions.ChangeNameAction;
import com.fr.design.designer.beans.events.DesignerEditor; import com.fr.design.designer.beans.events.DesignerEditor;
import com.fr.design.designer.creator.CRPropertyDescriptor; import com.fr.design.designer.creator.CRPropertyDescriptor;
import com.fr.design.designer.creator.XButton; import com.fr.design.designer.creator.XButton;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.gui.xtable.PropertyGroupModel;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.utils.ComponentUtils;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.Button; import com.fr.form.ui.Button;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
import com.fr.design.utils.ComponentUtils;
import com.fr.design.utils.gui.LayoutUtils; import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.beans.IntrospectionException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
public class CompositeComponentAdapter implements ComponentAdapter { public class CompositeComponentAdapter implements ComponentAdapter {
@ -81,7 +74,8 @@ public class CompositeComponentAdapter implements ComponentAdapter {
} }
//底层布局或者是自适应布局都不能删除 //底层布局或者是自适应布局都不能删除
boolean isRootComponent = ComponentUtils.isRootComponent(xCreator) || designer.isRoot(xCreator); boolean isRootComponent = ComponentUtils.isRootComponent(xCreator) || designer.isRoot(xCreator);
changeVarNameAction.setEnabled(!isRootComponent); //bug103155 有的布局的重命名(tab布局)涉及到其他非子节点的属性修改,支持起来比较麻烦,先屏蔽了控件树面板的修改,强制使用属性面板修改
changeVarNameAction.setEnabled(!isRootComponent && xCreator.supportRenameInWidgetTree());
popupMenu.add(changeVarNameAction); popupMenu.add(changeVarNameAction);
Action[] actions = designer.getActions(); Action[] actions = designer.getActions();

9
designer_form/src/com/fr/design/designer/creator/XCreator.java

@ -544,4 +544,13 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() {
return new WidgetPropertyUIProvider[0]; return new WidgetPropertyUIProvider[0];
} }
/**
* 控件树面板中是否支持重命名选项
*
* @return 控件树面板中是否支持重命名选项
*/
public boolean supportRenameInWidgetTree() {
return true;
}
} }

30
designer_form/src/com/fr/design/designer/creator/cardlayout/XWCardLayout.java

@ -3,33 +3,17 @@
*/ */
package com.fr.design.designer.creator.cardlayout; package com.fr.design.designer.creator.cardlayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ContainerEvent;
import java.beans.IntrospectionException;
import javax.swing.border.Border;
import com.fr.base.background.ColorBackground; import com.fr.base.background.ColorBackground;
import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.LayoutAdapter;
import com.fr.design.designer.beans.adapters.layout.FRCardLayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRCardLayoutAdapter;
import com.fr.design.designer.beans.models.SelectionModel; import com.fr.design.designer.beans.models.SelectionModel;
import com.fr.design.designer.creator.CRPropertyDescriptor; import com.fr.design.designer.creator.*;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWidgetCreator;
import com.fr.design.form.layout.FRCardLayout; import com.fr.design.form.layout.FRCardLayout;
import com.fr.design.form.util.XCreatorConstants; import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.widget.editors.CardTagWLayoutBorderStyleEditor; import com.fr.design.mainframe.widget.editors.CardTagWLayoutBorderStyleEditor;
import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer; import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer;
import com.fr.form.ui.CardAddButton; import com.fr.form.ui.*;
import com.fr.form.ui.CardSwitchButton;
import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.Widget;
import com.fr.form.ui.WidgetTitle;
import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WBorderLayout;
import com.fr.form.ui.container.WCardLayout; import com.fr.form.ui.container.WCardLayout;
import com.fr.form.ui.container.WLayout; import com.fr.form.ui.container.WLayout;
@ -41,6 +25,11 @@ import com.fr.general.Inter;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.border.Border;
import java.awt.*;
import java.awt.event.ContainerEvent;
import java.beans.IntrospectionException;
/** /**
* @author richer * @author richer
* @since 6.5.3 * @since 6.5.3
@ -379,4 +368,9 @@ public class XWCardLayout extends XLayoutContainer {
public XLayoutContainer getTopLayout() { public XLayoutContainer getTopLayout() {
return this.getBackupParent().getTopLayout(); return this.getBackupParent().getTopLayout();
} }
@Override
public boolean supportRenameInWidgetTree() {
return false;
}
} }
Loading…
Cancel
Save