|
|
@ -43,6 +43,7 @@ public class OnlineWidgetTabPane extends JPanel { |
|
|
|
private CardLayout cardLayout; |
|
|
|
private CardLayout cardLayout; |
|
|
|
private JPanel centerPane; |
|
|
|
private JPanel centerPane; |
|
|
|
private boolean packagePaneCreated = false; |
|
|
|
private boolean packagePaneCreated = false; |
|
|
|
|
|
|
|
private boolean componentPaneCreated = false; |
|
|
|
private final List<TabChangeListener> tabChangeListeners; |
|
|
|
private final List<TabChangeListener> tabChangeListeners; |
|
|
|
private OnlineEmbedFilterShowPane embedFilterShowPane; |
|
|
|
private OnlineEmbedFilterShowPane embedFilterShowPane; |
|
|
|
private OnlineWidgetPackagesShowPane widgetPackagesShowPane; |
|
|
|
private OnlineWidgetPackagesShowPane widgetPackagesShowPane; |
|
|
@ -57,8 +58,6 @@ public class OnlineWidgetTabPane extends JPanel { |
|
|
|
this.cardLayout = new CardLayout(); |
|
|
|
this.cardLayout = new CardLayout(); |
|
|
|
this.centerPane = new JPanel(cardLayout); |
|
|
|
this.centerPane = new JPanel(cardLayout); |
|
|
|
|
|
|
|
|
|
|
|
this.centerPane.add(new OnlineWidgetShowPane(sharableWidgets), COMPONENT); |
|
|
|
|
|
|
|
this.centerPane.add( embedFilterShowPane = new OnlineEmbedFilterShowPane(new OnlineWidgetShowPane(sharableWidgets, OnlineWidgetSortType.SALES)), COMPONENT_EMBED); |
|
|
|
|
|
|
|
//延迟组件包面板的初始化,防止组件面板里组件的缩略图和组件包面板里组件的缩略图一起加载
|
|
|
|
//延迟组件包面板的初始化,防止组件面板里组件的缩略图和组件包面板里组件的缩略图一起加载
|
|
|
|
this.headGroup = new UITabGroup(new String[]{COMPONENT_PACKAGE, COMPONENT}) { |
|
|
|
this.headGroup = new UITabGroup(new String[]{COMPONENT_PACKAGE, COMPONENT}) { |
|
|
|
public void tabChanged(int newSelectedIndex) { |
|
|
|
public void tabChanged(int newSelectedIndex) { |
|
|
@ -66,6 +65,12 @@ public class OnlineWidgetTabPane extends JPanel { |
|
|
|
changeListener.tabChange(newSelectedIndex); |
|
|
|
changeListener.tabChange(newSelectedIndex); |
|
|
|
} |
|
|
|
} |
|
|
|
if (newSelectedIndex == COMPONENT_TAB_INDEX) { |
|
|
|
if (newSelectedIndex == COMPONENT_TAB_INDEX) { |
|
|
|
|
|
|
|
//延迟组件包面板的初始化,防止组件面板里组件和缩略图和组件包面板里组件的缩略图一起加载
|
|
|
|
|
|
|
|
if (!componentPaneCreated) { |
|
|
|
|
|
|
|
centerPane.add(new OnlineWidgetShowPane(sharableWidgets), COMPONENT); |
|
|
|
|
|
|
|
centerPane.add( embedFilterShowPane = new OnlineEmbedFilterShowPane(new OnlineWidgetShowPane(sharableWidgets, OnlineWidgetSortType.SALES)), COMPONENT_EMBED); |
|
|
|
|
|
|
|
componentPaneCreated = true; |
|
|
|
|
|
|
|
} |
|
|
|
cardLayout.show(centerPane, ComponentShareUtil.needShowEmbedFilterPane() ? COMPONENT_EMBED : COMPONENT); |
|
|
|
cardLayout.show(centerPane, ComponentShareUtil.needShowEmbedFilterPane() ? COMPONENT_EMBED : COMPONENT); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
ComponentShareUtil.completeEmbedFilter(); |
|
|
|
ComponentShareUtil.completeEmbedFilter(); |
|
|
|