Browse Source
Merge in DESIGN/design from ~YUAN.WANG/design:release/10.0 to release/10.0 * commit '1108edcbf34d66f548a9f392a81293b996a4534b': REPORT-38778 去掉社区和模板商城的小红点,修正使用工厂类引起的bug,修改预装组件的逻辑 REPORT-38778 修改接口描述。添加了SnapChat的工厂 REPORT-38778 格式化 REPORT-38778 代码调整,去掉无用import REPORT-38778 1.新用户的小红点、弹窗提示; 2.去掉菜单项 3.新用户预装组件feature/big-screen
Yuan.Wang
4 years ago
11 changed files with 224 additions and 109 deletions
@ -0,0 +1,20 @@
|
||||
package com.fr.design.mainframe; |
||||
|
||||
import javax.swing.JWindow; |
||||
|
||||
/** |
||||
* @Author: Yuan.Wang |
||||
* @Date: 2020/10/9 |
||||
* 只关心Window的显示和隐藏操作时可以实现该接口 |
||||
*/ |
||||
public interface PromptWindow { |
||||
/** |
||||
* 显示弹窗 |
||||
*/ |
||||
void showWindow(); |
||||
|
||||
/** |
||||
* 隐藏弹窗 |
||||
*/ |
||||
void hideWindow(); |
||||
} |
@ -0,0 +1,22 @@
|
||||
package com.fr.design.notification; |
||||
|
||||
/** |
||||
* @Author: Yuan.Wang |
||||
* @Date: 2020/9/27 |
||||
*/ |
||||
public abstract class AbstractSnapChat implements SnapChat { |
||||
@Override |
||||
public boolean hasRead() { |
||||
|
||||
String calcKey = calcKey(); |
||||
Boolean val = SnapChatConfig.getInstance().hasRead(calcKey); |
||||
return val == null ? defaultStatus() : val; |
||||
} |
||||
|
||||
@Override |
||||
public void markRead() { |
||||
|
||||
String calcKey = calcKey(); |
||||
SnapChatConfig.getInstance().markRead(calcKey); |
||||
} |
||||
} |
@ -0,0 +1,32 @@
|
||||
package com.fr.design.notification; |
||||
|
||||
import com.fr.plugin.context.PluginContext; |
||||
|
||||
/** |
||||
* @Author: Yuan.Wang |
||||
* @Date: 2020/10/10 |
||||
*/ |
||||
public class SnapChatFactory { |
||||
public static SnapChat createSnapChat(boolean defaultStatus, SnapChatKey snapChatKey) { |
||||
return createSnapChat(defaultStatus, snapChatKey, null); |
||||
} |
||||
|
||||
public static SnapChat createSnapChat(boolean defaultStatus, SnapChatKey snapChatKey, PluginContext context) { |
||||
return new AbstractSnapChat() { |
||||
@Override |
||||
public boolean defaultStatus() { |
||||
return defaultStatus; |
||||
} |
||||
|
||||
@Override |
||||
public SnapChatKey key() { |
||||
return snapChatKey; |
||||
} |
||||
|
||||
@Override |
||||
public String calcKey() { |
||||
return context == null ? key().calc() : key().calc(context); |
||||
} |
||||
}; |
||||
} |
||||
} |
@ -1,9 +1,18 @@
|
||||
package com.fr.design.notification; |
||||
|
||||
import com.fr.plugin.context.PluginContext; |
||||
|
||||
/** |
||||
* created by Harrison on 2020/03/16 |
||||
**/ |
||||
public interface SnapChatKey { |
||||
|
||||
|
||||
String calc(); |
||||
|
||||
/** |
||||
* 插件刚被安装时不能通过PluginContexts.getContext()方法获取插件上下文,因此加一个接口 |
||||
*/ |
||||
default String calc(PluginContext context) { |
||||
throw new UnsupportedOperationException(); |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue