|
|
|
@ -13,7 +13,6 @@ import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane;
|
|
|
|
|
import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane; |
|
|
|
|
import com.fr.general.locale.LocaleCenter; |
|
|
|
|
import com.fr.general.locale.LocaleMark; |
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.Icon; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
@ -33,13 +32,15 @@ import java.util.List;
|
|
|
|
|
* Date: 14-7-8 |
|
|
|
|
* Time: 下午8:18 |
|
|
|
|
*/ |
|
|
|
|
public class FormWidgetDetailPane extends FormDockView{ |
|
|
|
|
public class FormWidgetDetailPane extends FormDockView { |
|
|
|
|
private static final int ONLINE_TAB = 1; |
|
|
|
|
|
|
|
|
|
private JPanel centerPane; |
|
|
|
|
private UIHeadGroup headGroup; |
|
|
|
|
private List<BasicPane> paneList; |
|
|
|
|
private CardLayout cardLayout; |
|
|
|
|
//用来标记当前组件库界面是否处于已触达状态
|
|
|
|
|
private boolean hasTouched = false; |
|
|
|
|
|
|
|
|
|
private boolean isEmptyPane = false; |
|
|
|
|
|
|
|
|
@ -50,7 +51,7 @@ public class FormWidgetDetailPane extends FormDockView{
|
|
|
|
|
return HOLDER.singleton; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private FormWidgetDetailPane(){ |
|
|
|
|
private FormWidgetDetailPane() { |
|
|
|
|
setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -77,7 +78,7 @@ public class FormWidgetDetailPane extends FormDockView{
|
|
|
|
|
/** |
|
|
|
|
* 初始化 |
|
|
|
|
*/ |
|
|
|
|
public void refreshDockingView(){ |
|
|
|
|
public void refreshDockingView() { |
|
|
|
|
if (isEmptyPane) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
@ -87,18 +88,18 @@ public class FormWidgetDetailPane extends FormDockView{
|
|
|
|
|
clearDockingView(); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
hasTouched = ComponentShareUtil.hasTouched(); |
|
|
|
|
initPaneList(); |
|
|
|
|
this.setBorder(null); |
|
|
|
|
cardLayout = new CardLayout(); |
|
|
|
|
centerPane = new JPanel(cardLayout); |
|
|
|
|
String[] paneNames = new String[paneList.size()]; |
|
|
|
|
for (int i = 0; i < paneList.size(); i++) { |
|
|
|
|
String title = paneList.get(i).getTitle(); |
|
|
|
|
String title = paneList.get(i).getTitle(); |
|
|
|
|
paneNames[i] = title; |
|
|
|
|
centerPane.add(paneList.get(i), title); |
|
|
|
|
} |
|
|
|
|
headGroup = new UIHeadGroup(paneNames) { |
|
|
|
|
headGroup = new UIHeadGroup(paneNames) { |
|
|
|
|
protected void tabChanged(int newSelectedIndex) { |
|
|
|
|
//初始化还未展示的时候不需要收集其 marketClick
|
|
|
|
|
if (this.isShowing() && newSelectedIndex == 1) { |
|
|
|
@ -106,20 +107,28 @@ public class FormWidgetDetailPane extends FormDockView{
|
|
|
|
|
} |
|
|
|
|
cardLayout.show(centerPane, paneList.get(newSelectedIndex).getTitle()); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
headGroup.setSelectedIndex(ComponentShareUtil.needSwitch2OnlineTab() ? ONLINE_TAB : 0); |
|
|
|
|
this.add(headGroup, BorderLayout.NORTH); |
|
|
|
|
this.add(centerPane, BorderLayout.CENTER); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 判断是否可触达 |
|
|
|
|
* |
|
|
|
|
* @return boolean |
|
|
|
|
*/ |
|
|
|
|
public boolean hasTouched() { |
|
|
|
|
return hasTouched; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void resetEmptyPane(){ |
|
|
|
|
public void resetEmptyPane() { |
|
|
|
|
this.isEmptyPane = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 清除数据 |
|
|
|
|
*/ |
|
|
|
@ -129,7 +138,7 @@ public class FormWidgetDetailPane extends FormDockView{
|
|
|
|
|
this.add(psp, BorderLayout.CENTER); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void switch2Empty(){ |
|
|
|
|
public void switch2Empty() { |
|
|
|
|
isEmptyPane = true; |
|
|
|
|
this.removeAll(); |
|
|
|
|
JPanel panel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 5); |
|
|
|
@ -162,7 +171,7 @@ public class FormWidgetDetailPane extends FormDockView{
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void enterWidgetLib() { |
|
|
|
|
public void enterWidgetLib() { |
|
|
|
|
ComponentReuseNotifyUtil.enterWidgetLibExtraAction(); |
|
|
|
|
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_LIB); |
|
|
|
|
} |
|
|
|
|