Browse Source

Pull request #5701: REPORT-57868 解决单元格切换元素的异常问题

Merge in DESIGN/design from ~TOMMY/design:release/11.0 to release/11.0

* commit '52c9bbd735a31173b94e6b782f03facc43abe1a1':
  EPORT-58647 创建共享组件封面图没有绘制背景标题
  REPORT-58746 zip安装失败提示
  REPORT-57868 解决单元格切换元素的异常问题
persist/11.0
Tommy 3 years ago
parent
commit
2de775e751
  1. 4
      designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java
  2. 4
      designer-form/src/main/java/com/fr/design/mainframe/share/action/InstallComponentAction.java
  3. 9
      designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java
  4. 8
      designer-realize/src/main/java/com/fr/design/actions/insert/cell/GeneralCellAction.java
  5. 9
      designer-realize/src/main/java/com/fr/design/cell/editor/TextCellEditor.java

4
designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java

@ -251,7 +251,7 @@ public class CreateComponentAction extends UpdateAction {
private Image componentToImage(Component comp, Rectangle rect) { private Image componentToImage(Component comp, Rectangle rect) {
BufferedImage im = new BufferedImage((int) rect.getWidth(), (int) rect.getHeight(), BufferedImage.TYPE_INT_ARGB); BufferedImage im = new BufferedImage((int) rect.getWidth(), (int) rect.getHeight(), BufferedImage.TYPE_INT_RGB);
comp.paint(im.getGraphics()); comp.paint(im.getGraphics());
return im; return im;
} }
@ -260,7 +260,7 @@ public class CreateComponentAction extends UpdateAction {
private Image moduleToImage(Form form, ElementCaseEditor editor, Map<String, Object> parameterMap, Rectangle rect) { private Image moduleToImage(Form form, ElementCaseEditor editor, Map<String, Object> parameterMap, Rectangle rect) {
if (editor == null) { if (editor == null) {
return new BufferedImage((int) rect.getWidth(), (int) rect.getHeight(), BufferedImage.TYPE_INT_ARGB); return new BufferedImage((int) rect.getWidth(), (int) rect.getHeight(), BufferedImage.TYPE_INT_RGB);
} }
FormElementCaseProvider provider = editor.getElementCase(); FormElementCaseProvider provider = editor.getElementCase();
provider.setName(editor.getWidgetName()); provider.setName(editor.getWidgetName());

4
designer-form/src/main/java/com/fr/design/mainframe/share/action/InstallComponentAction.java

@ -95,7 +95,9 @@ public class InstallComponentAction extends UpdateAction {
} }
ShareWidgetInfoManager.getInstance().saveXmlInfo(); ShareWidgetInfoManager.getInstance().saveXmlInfo();
boolean needShowMessage = (chosenFiles.length > 1 && chosenFiles.length != failureList.size()) || containRues(chosenFiles); boolean reuNeedShowMessage = chosenFiles.length > 1 && chosenFiles.length != failureList.size();
boolean reusNeedShowMessage = containRues(chosenFiles) && !failureList.isEmpty();
boolean needShowMessage = reuNeedShowMessage || reusNeedShowMessage;
return new InstallBackInfo(installStatus, needShowMessage, failureList); return new InstallBackInfo(installStatus, needShowMessage, failureList);
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);

9
designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java

@ -30,9 +30,14 @@ public class InstallUtils {
* 安装组件包 * 安装组件包
*/ */
public static boolean installReusFile(File chosenFile, long installTime, List<String> list) { public static boolean installReusFile(File chosenFile, long installTime, List<String> list) {
return installReusFile(chosenFile, installTime, list, o -> { InstallResult installResult = installReusFile(chosenFile, installTime, list, o -> {
//do nothing //do nothing
}).installStatus; });
Group group = installResult.group;
if (group.getAllBindInfoList().length == 0) {
DefaultShareGroupManager.getInstance().removeGroup(group);
}
return installResult.installStatus;
} }
/** /**

8
designer-realize/src/main/java/com/fr/design/actions/insert/cell/GeneralCellAction.java

@ -10,6 +10,7 @@ import com.fr.design.menu.MenuKeySet;
import javax.swing.*; import javax.swing.*;
import java.awt.event.ActionEvent;
/** /**
* *
@ -52,4 +53,11 @@ public class GeneralCellAction extends AbstractCellAction implements WorkBookSup
public Class getCellValueClass() { public Class getCellValueClass() {
return String.class; return String.class;
} }
@Override
public void actionPerformed(ActionEvent evt) {
super.actionPerformed(evt);
this.getEditingComponent().getGrid().getCellEditor().stopCellEditing();
}
} }

9
designer-realize/src/main/java/com/fr/design/cell/editor/TextCellEditor.java

@ -129,7 +129,7 @@ public class TextCellEditor extends AbstractCellEditor {
} }
this.oldValue = Utils.objectToString(value); this.oldValue = Utils.objectToString(value);
this.textField.setText(oldValue); resetTextWithoutDocumentListener(oldValue);
//peter:只读方式获得Style. //peter:只读方式获得Style.
Style style = null; Style style = null;
if(cellElement != null) { if(cellElement != null) {
@ -176,4 +176,11 @@ public class TextCellEditor extends AbstractCellEditor {
public void keyReleased(KeyEvent evt) { public void keyReleased(KeyEvent evt) {
} }
}; };
private void resetTextWithoutDocumentListener(String text) {
this.textField.getDocument().removeDocumentListener(documentlistener);
this.textField.setText(text);
this.textField.getDocument().addDocumentListener(documentlistener);
}
} }
Loading…
Cancel
Save