Browse Source
* commit '47ab6595baf2eb0fb93ba1bcab3bd9711b8c131b': f remove useless code REPORT-11623 模板加密research/10.0
yaoh.wu
6 years ago
23 changed files with 349 additions and 97 deletions
@ -0,0 +1,83 @@
|
||||
package com.fr.base.vcs; |
||||
|
||||
import com.fr.design.base.mode.DesignModeContext; |
||||
|
||||
/** |
||||
* 兼容 |
||||
* |
||||
* @deprecated user {@link com.fr.design.base.mode.DesignerMode} and {@link DesignModeContext} instead |
||||
*/ |
||||
@Deprecated |
||||
public enum DesignerMode { |
||||
|
||||
NORMAL() { |
||||
@Override |
||||
public void doSwitch() { |
||||
DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.NORMAL); |
||||
} |
||||
}, |
||||
VCS() { |
||||
@Override |
||||
public void doSwitch() { |
||||
DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.VCS); |
||||
} |
||||
}, |
||||
AUTHORITY() { |
||||
@Override |
||||
public void doSwitch() { |
||||
DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.AUTHORITY); |
||||
} |
||||
}; |
||||
|
||||
abstract void doSwitch(); |
||||
|
||||
|
||||
/** |
||||
* @return 是否时版本控制模式 |
||||
* @deprecated use {@link DesignModeContext#isVcsMode()} instead |
||||
*/ |
||||
@Deprecated |
||||
public static boolean isVcsMode() { |
||||
return DesignModeContext.isVcsMode(); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 切换设计器模式 |
||||
* |
||||
* @param mode mode |
||||
* @deprecated use {@link DesignModeContext#switchTo(com.fr.design.base.mode.DesignerMode)} instead |
||||
*/ |
||||
@Deprecated |
||||
public static void setMode(DesignerMode mode) { |
||||
mode.doSwitch(); |
||||
} |
||||
|
||||
/** |
||||
* @return 获取当前设计器模式 |
||||
* @deprecated use {@link DesignModeContext#getMode()} instead |
||||
*/ |
||||
@Deprecated |
||||
public static DesignerMode getMode() { |
||||
switch (DesignModeContext.getMode()) { |
||||
case VCS: |
||||
return VCS; |
||||
case AUTHORITY: |
||||
return AUTHORITY; |
||||
case NORMAL: |
||||
default: |
||||
return NORMAL; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 是否为权限编辑 |
||||
* |
||||
* @return 是否为权限编辑 |
||||
* @deprecated use {@link DesignModeContext#isAuthorityEditing()} instead |
||||
*/ |
||||
@Deprecated |
||||
public static boolean isAuthorityEditing() { |
||||
return DesignModeContext.isAuthorityEditing(); |
||||
} |
||||
} |
@ -0,0 +1,42 @@
|
||||
package com.fr.design.base.mode; |
||||
|
||||
import static com.fr.design.base.mode.DesignerMode.AUTHORITY; |
||||
|
||||
public class DesignModeContext { |
||||
|
||||
private static DesignerMode mode = DesignerMode.NORMAL; |
||||
|
||||
public static void switchTo(DesignerMode mode) { |
||||
DesignModeContext.mode = mode; |
||||
} |
||||
|
||||
public static DesignerMode getMode() { |
||||
return mode; |
||||
} |
||||
|
||||
/** |
||||
* 是否是版本控制模式 |
||||
* |
||||
* @return 是否是版本控制模式 |
||||
*/ |
||||
public static boolean isVcsMode() { |
||||
return mode == DesignerMode.VCS; |
||||
} |
||||
|
||||
/** |
||||
* @return 是否是禁止拷贝剪切模式 |
||||
*/ |
||||
public static boolean isBanCopyAndCut() { |
||||
return mode == DesignerMode.BAN_COPY_AND_CUT; |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 是否为权限编辑 |
||||
* |
||||
* @return 是否为权限编辑 |
||||
*/ |
||||
public static boolean isAuthorityEditing() { |
||||
return mode == AUTHORITY; |
||||
} |
||||
} |
@ -0,0 +1,8 @@
|
||||
package com.fr.design.base.mode; |
||||
|
||||
public enum DesignerMode { |
||||
NORMAL, |
||||
BAN_COPY_AND_CUT, |
||||
VCS, |
||||
AUTHORITY |
||||
} |
Loading…
Reference in new issue