forked from fanruan/design
kerry
5 years ago
5 changed files with 146 additions and 3 deletions
@ -0,0 +1,22 @@
|
||||
package com.fr.design.style.preference; |
||||
|
||||
import com.fr.stable.fun.mark.Mutable; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-11-04 |
||||
*/ |
||||
public interface PreferenceConfigProvider extends Mutable { |
||||
|
||||
String XML_TAG = "PreferenceConfigProvider"; |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
/** |
||||
* 获取tab配置项 |
||||
* @return tab配置项 |
||||
*/ |
||||
List<PreferenceTabConfig> getConfigList(); |
||||
|
||||
} |
@ -0,0 +1,32 @@
|
||||
package com.fr.design.style.preference; |
||||
|
||||
import com.fr.base.Style; |
||||
|
||||
import javax.swing.JComponent; |
||||
import javax.swing.event.ChangeListener; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-11-04 |
||||
*/ |
||||
public interface PreferenceTabConfig { |
||||
/** |
||||
* @return tab的标题 |
||||
*/ |
||||
String tabName(); |
||||
|
||||
/** |
||||
* @param changeListener 需要添加的listener |
||||
* @return tab对应的component |
||||
*/ |
||||
JComponent tabComponent(ChangeListener changeListener); |
||||
|
||||
/** |
||||
* @return 更新后的样式 |
||||
*/ |
||||
Style updateTabConfig(); |
||||
|
||||
/** |
||||
* @param style 待渲染的样式 |
||||
*/ |
||||
void populateTabConfig(Style style); |
||||
} |
@ -0,0 +1,29 @@
|
||||
package com.fr.design.style.preference.impl; |
||||
|
||||
import com.fr.design.style.preference.PreferenceConfigProvider; |
||||
import com.fr.design.style.preference.PreferenceTabConfig; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-11-04 |
||||
*/ |
||||
@API(level = PreferenceConfigProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractPreferenceConfigProvider implements PreferenceConfigProvider { |
||||
@Override |
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return getClass().getName(); |
||||
} |
||||
|
||||
@Override |
||||
public List<PreferenceTabConfig> getConfigList() { |
||||
return new ArrayList<PreferenceTabConfig>(); |
||||
} |
||||
} |
@ -0,0 +1,33 @@
|
||||
package com.fr.design.style.preference.impl; |
||||
|
||||
import com.fr.base.Style; |
||||
import com.fr.design.style.preference.PreferenceTabConfig; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
import javax.swing.JComponent; |
||||
import javax.swing.event.ChangeListener; |
||||
|
||||
/** |
||||
* Created by kerry on 2019-11-04 |
||||
*/ |
||||
public abstract class AbstractPreferenceTabConfig implements PreferenceTabConfig { |
||||
@Override |
||||
public String tabName() { |
||||
return StringUtils.EMPTY; |
||||
} |
||||
|
||||
@Override |
||||
public JComponent tabComponent(ChangeListener changeListener) { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public Style updateTabConfig() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public void populateTabConfig(Style style) { |
||||
|
||||
} |
||||
} |
Loading…
Reference in new issue