diff --git a/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java b/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java index f283904be3..a7936a8288 100644 --- a/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java +++ b/designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java @@ -112,9 +112,12 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP EastRegionContainerPane.getInstance().replaceDownPane( FormWidgetDetailPane.getInstance(this)); if (!BaseUtils.isAuthorityEditing()) { + EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(this)); + EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(this).getPreferredSize().height); EastRegionContainerPane.getInstance().replaceUpPane( WidgetPropertyPane.getInstance(this)); } else { + EastRegionContainerPane.getInstance().removeParameterPane(); showAuthorityEditPane(); } @@ -230,8 +233,6 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP } ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean( p.getParameterArray() == null ? new Parameter[0] : p.getParameterArray()); - EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(this)); - EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(this).getPreferredSize().height); } diff --git a/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java index a1fb5f1476..5beea605c8 100644 --- a/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; +import com.fr.base.FRContext; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.UIDialog; import com.fr.design.extra.PluginWebBridge; @@ -19,6 +20,8 @@ import com.fr.form.share.ShareConstants; import com.fr.form.share.ShareLoader; import com.fr.form.ui.ElCaseBindInfo; import com.fr.general.Inter; +import com.fr.general.SiteCenter; +import com.fr.stable.StringUtils; import javax.swing.*; import javax.swing.filechooser.FileNameExtensionFilter; @@ -29,6 +32,8 @@ import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.io.File; import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; /** * Created with IntelliJ IDEA. @@ -220,10 +225,23 @@ public class FormWidgetDetailPane extends FormDockView{ downloadItem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - BasicPane managerPane = new WebManagerPaneFactory().createReusePane(); - UIDialog dlg = new ShopDialog(DesignerContext.getDesignerFrame(), managerPane); - PluginWebBridge.getHelper().setDialogHandle(dlg); - dlg.setVisible(true); + String url = SiteCenter.getInstance().acquireUrlByKind("reuse.url"); + if (StringUtils.isEmpty(url)) { + FRContext.getLogger().info("The URL is empty!"); + return; + } + try { + Desktop.getDesktop().browse(new URI(url)); + } catch (IOException exp) { + JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); + FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + } catch (URISyntaxException exp) { + FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + } catch (Exception exp) { + FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); + FRContext.getLogger().error("Can not open the browser for URL: " + url); + } + } }); diff --git a/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java b/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java index ef01c7b711..38b62a99a1 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java +++ b/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java @@ -107,7 +107,7 @@ public class UITreeComboBox extends JComboBox{ class UITreeComboBoxRenderer extends DefaultListCellRenderer { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus){ - if(tree != null ){ + if(tree != null && tree.getSelectedTreePath().length > 0){ TreePath path = tree.getSelectedTreePath()[0]; tree.setAndScrollSelectionPath(path); Object node = path.getLastPathComponent(); @@ -131,14 +131,12 @@ public class UITreeComboBox extends JComboBox{ public void fireCreatorModified(DesignerEvent evt) { if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED || evt.getCreatorEventID() == DesignerEvent.CREATOR_PASTED) { TreePath[] paths = tree.getSelectedTreePath(); - - if (paths.length == 1) { + if (tree != null && paths.length > 0) { tree.setAndScrollSelectionPath(paths[0]); - } else { - tree.setSelectionPaths(paths); + setSelectedItem(paths[0]); + MenuSelectionManager.defaultManager().clearSelectedPath(); } - setSelectedItem(paths[0]); - MenuSelectionManager.defaultManager().clearSelectedPath(); + } else { tree.refreshUI(); repaint(); @@ -205,7 +203,7 @@ class TreePopup extends JPopupMenu implements ComboPopup{ } } - public void show(){ + public void show() { updatePopup(); show(comboBox, 0, comboBox.getHeight()); comboBox.getTree().requestFocus();