12 changed files with 94 additions and 75 deletions
@ -0,0 +1,20 @@ |
|||||||
|
package com.fr.design.designer.beans.actions.behavior; |
||||||
|
|
||||||
|
import com.fr.design.designer.beans.actions.FormWidgetEditAction; |
||||||
|
import com.fr.design.mainframe.FormDesigner; |
||||||
|
|
||||||
|
/** |
||||||
|
* 只对控件有效,对底层布局(form/body)无效 |
||||||
|
* Created by plough on 2018/1/19. |
||||||
|
*/ |
||||||
|
public class ComponentEnable implements UpdateBehavior { |
||||||
|
@Override |
||||||
|
public void doUpdate(FormWidgetEditAction action) { |
||||||
|
FormDesigner designer = action.getEditingComponent(); |
||||||
|
if (designer == null) { |
||||||
|
action.setEnabled(false); |
||||||
|
return; |
||||||
|
} |
||||||
|
action.setEnabled(!designer.isRootSelected()); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,19 @@ |
|||||||
|
package com.fr.design.designer.beans.actions.behavior; |
||||||
|
|
||||||
|
import com.fr.design.designer.beans.actions.FormWidgetEditAction; |
||||||
|
import com.fr.design.mainframe.FormDesigner; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by plough on 2018/1/19. |
||||||
|
*/ |
||||||
|
public class MovableDownEnable implements UpdateBehavior { |
||||||
|
@Override |
||||||
|
public void doUpdate(FormWidgetEditAction action) { |
||||||
|
FormDesigner designer = action.getEditingComponent(); |
||||||
|
if (designer == null) { |
||||||
|
action.setEnabled(false); |
||||||
|
return; |
||||||
|
} |
||||||
|
action.setEnabled(designer.isCurrentComponentMovableDown()); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,19 @@ |
|||||||
|
package com.fr.design.designer.beans.actions.behavior; |
||||||
|
|
||||||
|
import com.fr.design.designer.beans.actions.FormWidgetEditAction; |
||||||
|
import com.fr.design.mainframe.FormDesigner; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by plough on 2018/1/19. |
||||||
|
*/ |
||||||
|
public class MovableUpEnable implements UpdateBehavior { |
||||||
|
@Override |
||||||
|
public void doUpdate(FormWidgetEditAction action) { |
||||||
|
FormDesigner designer = action.getEditingComponent(); |
||||||
|
if (designer == null) { |
||||||
|
action.setEnabled(false); |
||||||
|
return; |
||||||
|
} |
||||||
|
action.setEnabled(designer.isCurrentComponentMovableUp()); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,10 @@ |
|||||||
|
package com.fr.design.designer.beans.actions.behavior; |
||||||
|
|
||||||
|
import com.fr.design.designer.beans.actions.FormWidgetEditAction; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by plough on 2018/1/19. |
||||||
|
*/ |
||||||
|
public interface UpdateBehavior { |
||||||
|
public void doUpdate(FormWidgetEditAction action); |
||||||
|
} |
Loading…
Reference in new issue