17 changed files with 157 additions and 50 deletions
@ -0,0 +1,13 @@ |
|||||||
|
package com.fr.design.event; |
||||||
|
|
||||||
|
import java.util.EventListener; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by plough on 2018/1/19. |
||||||
|
*/ |
||||||
|
public interface DesignerOpenedListener extends EventListener { |
||||||
|
/** |
||||||
|
* Invoked when the target of the listener has changed the rpt content. |
||||||
|
*/ |
||||||
|
public void designerOpened(); |
||||||
|
} |
@ -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<FormWidgetEditAction> { |
||||||
|
@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<FormWidgetEditAction> { |
||||||
|
@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<FormWidgetEditAction> { |
||||||
|
@Override |
||||||
|
public void doUpdate(FormWidgetEditAction action) { |
||||||
|
FormDesigner designer = action.getEditingComponent(); |
||||||
|
if (designer == null) { |
||||||
|
action.setEnabled(false); |
||||||
|
return; |
||||||
|
} |
||||||
|
action.setEnabled(designer.isCurrentComponentMovableUp()); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,8 @@ |
|||||||
|
package com.fr.design.designer.beans.actions.behavior; |
||||||
|
|
||||||
|
/** |
||||||
|
* Created by plough on 2018/1/19. |
||||||
|
*/ |
||||||
|
public interface UpdateBehavior<T> { |
||||||
|
public void doUpdate(T t); |
||||||
|
} |
Loading…
Reference in new issue