Browse Source

Merge pull request #469 in BA/design from ~XIAOXIA/design:dev to dev

* commit '6fb118eea1d3946fd8df50a39c464c27d5407243':
  组件复用修复bug
  rt
  rt
master
superman 8 years ago
parent
commit
725b51c8b3
  1. 5
      designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java
  2. 26
      designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java
  3. 14
      designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java

5
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);
}

26
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);
}
}
});

14
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();

Loading…
Cancel
Save