forked from fanruan/design
hades
3 years ago
19 changed files with 155 additions and 31 deletions
@ -0,0 +1,20 @@ |
|||||||
|
package com.fr.design.env; |
||||||
|
|
||||||
|
/** |
||||||
|
* |
||||||
|
* @author hades |
||||||
|
* @version 10.0 |
||||||
|
* Created by hades on 2021/8/24 |
||||||
|
*/ |
||||||
|
public class DesignerWorkspaceInfoContext { |
||||||
|
|
||||||
|
private static DesignerWorkspaceInfo workspaceInfo; |
||||||
|
|
||||||
|
public static DesignerWorkspaceInfo getWorkspaceInfo() { |
||||||
|
return workspaceInfo; |
||||||
|
} |
||||||
|
|
||||||
|
public static void setWorkspaceInfo(DesignerWorkspaceInfo workspaceInfo) { |
||||||
|
DesignerWorkspaceInfoContext.workspaceInfo = workspaceInfo; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
package com.fr.design.designer.beans.actions.behavior; |
||||||
|
|
||||||
|
import com.fr.design.designer.beans.actions.FormWidgetEditAction; |
||||||
|
import com.fr.design.mainframe.FormDesigner; |
||||||
|
|
||||||
|
public class CopyableEnable implements UpdateBehavior<FormWidgetEditAction> { |
||||||
|
@Override |
||||||
|
public void doUpdate(FormWidgetEditAction action) { |
||||||
|
FormDesigner designer = action.getEditingComponent(); |
||||||
|
if (designer == null) { |
||||||
|
action.setEnabled(false); |
||||||
|
return; |
||||||
|
} |
||||||
|
action.setEnabled(designer.isCurrentComponentCopyable()); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
package com.fr.design.designer.beans.actions.behavior; |
||||||
|
|
||||||
|
import com.fr.design.designer.beans.actions.FormWidgetEditAction; |
||||||
|
import com.fr.design.mainframe.FormDesigner; |
||||||
|
|
||||||
|
public class CutableEnable implements UpdateBehavior<FormWidgetEditAction> { |
||||||
|
@Override |
||||||
|
public void doUpdate(FormWidgetEditAction action) { |
||||||
|
FormDesigner designer = action.getEditingComponent(); |
||||||
|
if (designer == null) { |
||||||
|
action.setEnabled(false); |
||||||
|
return; |
||||||
|
} |
||||||
|
action.setEnabled(designer.isCurrentComponentCutable()); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,16 @@ |
|||||||
|
package com.fr.design.designer.beans.actions.behavior; |
||||||
|
|
||||||
|
import com.fr.design.designer.beans.actions.FormWidgetEditAction; |
||||||
|
import com.fr.design.mainframe.FormDesigner; |
||||||
|
|
||||||
|
public class DeletableEnable implements UpdateBehavior<FormWidgetEditAction> { |
||||||
|
@Override |
||||||
|
public void doUpdate(FormWidgetEditAction action) { |
||||||
|
FormDesigner designer = action.getEditingComponent(); |
||||||
|
if (designer == null) { |
||||||
|
action.setEnabled(false); |
||||||
|
return; |
||||||
|
} |
||||||
|
action.setEnabled(designer.isCurrentComponentDeletable()); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue