Browse Source

REPORT-34878 && REPORT-34936 linux下条件属性和超链保存问题

feature/big-screen
hades 4 years ago
parent
commit
23a94b9371
  1. 4
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java
  2. 4
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java
  3. 39
      designer-base/src/main/java/com/fr/design/os/impl/PopupDialogSaveAction.java
  4. 7
      designer-realize/src/main/java/com/fr/grid/GridMouseAdapter.java

4
designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java

@ -9,12 +9,14 @@ import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.menu.ShortCut;
import com.fr.design.os.impl.PopupDialogSaveAction;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.invoke.Reflect;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.os.OperatingSystem;
import com.fr.stable.os.support.OSSupportCenter;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
@ -273,6 +275,8 @@ abstract class UIControlPane extends JControlPane {
}
saveSettings();
setVisible(false);
PopupDialogSaveAction saveAction = OSSupportCenter.getAction(PopupDialogSaveAction.class);
saveAction.unregister();
}
private void initListener() {

4
designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java

@ -7,9 +7,11 @@ import com.fr.design.gui.ilist.JNameEdList;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.gui.ilist.UINameEdList;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.os.impl.PopupDialogSaveAction;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
import com.fr.stable.os.support.OSSupportCenter;
import javax.swing.DefaultListModel;
import javax.swing.JList;
@ -216,6 +218,8 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon
((PopupEditDialog)popupEditDialog).setTitle(getSelectedName());
}
popupEditDialog.setVisible(true);
PopupDialogSaveAction osBasedAction = OSSupportCenter.getAction(PopupDialogSaveAction.class);
osBasedAction.execute(this, popupEditDialog);
}
}

39
designer-base/src/main/java/com/fr/design/os/impl/PopupDialogSaveAction.java

@ -0,0 +1,39 @@
package com.fr.design.os.impl;
import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.stable.os.OperatingSystem;
import com.fr.stable.os.support.OSBasedAction;
import java.awt.*;
/**
* linux下超链弹窗等保存问题
*
* @author hades
* @version 10.0
* Created by hades on 2020/7/21
*/
public class PopupDialogSaveAction implements OSBasedAction {
private UIListControlPane currentControlPane;
private Window popupDialog;
@Override
public void execute(Object... objects) {
boolean canSave = OperatingSystem.isLinux() && popupDialog != null && popupDialog.isVisible() && currentControlPane != null;
if (canSave) {
currentControlPane.saveSettings();
}
}
public void register(UIListControlPane currentControlPane, Window popupDialog) {
this.currentControlPane = currentControlPane;
this.popupDialog = popupDialog;
}
public void unregister() {
this.currentControlPane = null;
this.popupDialog = null;
}
}

7
designer-realize/src/main/java/com/fr/grid/GridMouseAdapter.java

@ -10,7 +10,7 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.JSliderPane;
import com.fr.design.present.CellWriteAttrPane;
import com.fr.design.os.impl.PopupDialogSaveAction;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
@ -26,6 +26,7 @@ import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.ArrayUtils;
import com.fr.stable.ColumnRow;
import com.fr.stable.StringUtils;
import com.fr.stable.os.support.OSSupportCenter;
import com.fr.stable.unit.FU;
import javax.swing.*;
@ -93,7 +94,9 @@ public class GridMouseAdapter implements MouseListener, MouseWheelListener, Mous
if (!grid.hasFocus() && grid.isRequestFocusEnabled()) {
grid.requestFocus();
}
// linux下 点击单元格时 失焦之前立即触发保存
PopupDialogSaveAction saveAction = OSSupportCenter.getAction(PopupDialogSaveAction.class);
saveAction.execute();
if (SwingUtilities.isRightMouseButton(evt)) {
doWithRightButtonPressed();
} else {

Loading…
Cancel
Save