|
|
@ -145,7 +145,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { |
|
|
|
}; |
|
|
|
}; |
|
|
|
PluginListenerRegistration.getInstance().listen( |
|
|
|
PluginListenerRegistration.getInstance().listen( |
|
|
|
PluginEventType.AfterRun, |
|
|
|
PluginEventType.AfterRun, |
|
|
|
new PluginEventListener() { |
|
|
|
new PluginEventListener(PropertyItemPaneProvider.FIRST) { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void on(PluginEvent event) { |
|
|
|
public void on(PluginEvent event) { |
|
|
|
PluginContext context = event.getContext(); |
|
|
|
PluginContext context = event.getContext(); |
|
|
@ -159,7 +159,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { |
|
|
|
}, filter); |
|
|
|
}, filter); |
|
|
|
PluginListenerRegistration.getInstance().listen( |
|
|
|
PluginListenerRegistration.getInstance().listen( |
|
|
|
PluginEventType.BeforeStop, |
|
|
|
PluginEventType.BeforeStop, |
|
|
|
new PluginEventListener(10) { |
|
|
|
new PluginEventListener(PropertyItemPaneProvider.FIRST) { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void on(PluginEvent event) { |
|
|
|
public void on(PluginEvent event) { |
|
|
|
PluginContext context = event.getContext(); |
|
|
|
PluginContext context = event.getContext(); |
|
|
@ -201,10 +201,14 @@ public class EastRegionContainerPane extends UIEastResizableContainer { |
|
|
|
String key = provider.key(); |
|
|
|
String key = provider.key(); |
|
|
|
PropertyItemBean itemBean = provider.getItem(); |
|
|
|
PropertyItemBean itemBean = provider.getItem(); |
|
|
|
PropertyItem propertyItem = new PropertyItem(itemBean.getName(), |
|
|
|
PropertyItem propertyItem = new PropertyItem(itemBean.getName(), |
|
|
|
itemBean.getTitle(), |
|
|
|
itemBean.getTitle(), |
|
|
|
itemBean.getBtnIconName(), |
|
|
|
itemBean.getBtnIconName(), |
|
|
|
itemBean.getVisibleModes(), |
|
|
|
itemBean.getVisibleModes(), |
|
|
|
itemBean.getEnableModes()); |
|
|
|
itemBean.getEnableModes()); |
|
|
|
|
|
|
|
String btnIconBaseDir = itemBean.getBtnIconBaseDir(); |
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(btnIconBaseDir)) { |
|
|
|
|
|
|
|
propertyItem.setIconBaseDir(btnIconBaseDir); |
|
|
|
|
|
|
|
} |
|
|
|
UIButton button = propertyItem.getButton(); |
|
|
|
UIButton button = propertyItem.getButton(); |
|
|
|
List<ActionListener> buttonListeners = itemBean.getButtonListeners(); |
|
|
|
List<ActionListener> buttonListeners = itemBean.getButtonListeners(); |
|
|
|
for (ActionListener buttonListener : buttonListeners) { |
|
|
|
for (ActionListener buttonListener : buttonListeners) { |
|
|
@ -648,14 +652,21 @@ public class EastRegionContainerPane extends UIEastResizableContainer { |
|
|
|
private static final String ICON_SUFFIX_DISABLED = "_disabled.png"; |
|
|
|
private static final String ICON_SUFFIX_DISABLED = "_disabled.png"; |
|
|
|
private static final String ICON_SUFFIX_SELECTED = "_selected.png"; |
|
|
|
private static final String ICON_SUFFIX_SELECTED = "_selected.png"; |
|
|
|
private String btnIconName; |
|
|
|
private String btnIconName; |
|
|
|
|
|
|
|
private String iconBaseDir; |
|
|
|
private String iconSuffix = ICON_SUFFIX_NORMAL; // normal, diabled, selected, 三者之一
|
|
|
|
private String iconSuffix = ICON_SUFFIX_NORMAL; // normal, diabled, selected, 三者之一
|
|
|
|
private final Color selectedBtnBackground = new Color(0xF5F5F7); |
|
|
|
private final Color selectedBtnBackground = new Color(0xF5F5F7); |
|
|
|
private Color originBtnBackground; |
|
|
|
private Color originBtnBackground; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public PropertyItem(String name, String title, String btnIconName, PropertyMode[] visibleModes, PropertyMode[] enableModes) { |
|
|
|
public PropertyItem(String name, String title, String btnIconName, PropertyMode[] visibleModes, PropertyMode[] enableModes) { |
|
|
|
|
|
|
|
this(name, title, btnIconName, ICON_BASE_DIR, visibleModes, enableModes); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public PropertyItem(String name, String title, String btnIconName, String iconBaseDir, PropertyMode[] visibleModes, PropertyMode[] enableModes) { |
|
|
|
this.name = name; |
|
|
|
this.name = name; |
|
|
|
this.title = title; |
|
|
|
this.title = title; |
|
|
|
this.btnIconName = btnIconName; |
|
|
|
this.btnIconName = btnIconName; |
|
|
|
|
|
|
|
this.iconBaseDir = iconBaseDir; |
|
|
|
initButton(); |
|
|
|
initButton(); |
|
|
|
initPropertyPanel(); |
|
|
|
initPropertyPanel(); |
|
|
|
initModes(visibleModes, enableModes); |
|
|
|
initModes(visibleModes, enableModes); |
|
|
@ -713,6 +724,15 @@ public class EastRegionContainerPane extends UIEastResizableContainer { |
|
|
|
button.setEnabled(isEnabled); |
|
|
|
button.setEnabled(isEnabled); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setIconBaseDir(String iconBaseDir) { |
|
|
|
|
|
|
|
this.iconBaseDir = iconBaseDir; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String getIconBaseDir() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return StringUtils.isEmpty(iconBaseDir) ? ICON_BASE_DIR : iconBaseDir; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initPropertyPanel() { |
|
|
|
private void initPropertyPanel() { |
|
|
|
propertyPanel = new JPanel(); |
|
|
|
propertyPanel = new JPanel(); |
|
|
|
propertyPanel.setBackground(Color.pink); |
|
|
|
propertyPanel.setBackground(Color.pink); |
|
|
@ -793,7 +813,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private String getBtnIconUrl() { |
|
|
|
private String getBtnIconUrl() { |
|
|
|
return ICON_BASE_DIR + btnIconName + iconSuffix; |
|
|
|
|
|
|
|
|
|
|
|
return getIconBaseDir() + btnIconName + iconSuffix; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void resetButtonIcon() { |
|
|
|
public void resetButtonIcon() { |
|
|
|