Browse Source

Merge pull request #1144 in BA/design from ~MOMEAK/design9.0:release/9.0 to release/9.0

* commit '31a8ec836435e8a018daa8b1a59d4a7c6a26a443':
  PMD
  REPORT-2897 9.0设计器修改 调整右击菜单顺序,去掉多余的...
master
kerry 7 years ago
parent
commit
e8db8dd8c8
  1. 5
      designer/src/com/fr/design/actions/cell/CellAttributeAction.java
  2. 2
      designer/src/com/fr/design/actions/edit/HyperlinkAction.java
  3. 33
      designer/src/com/fr/grid/selection/CellSelection.java
  4. 6
      designer_base/src/com/fr/design/menu/KeySetUtils.java

5
designer/src/com/fr/design/actions/cell/CellAttributeAction.java

@ -1,5 +1,6 @@
package com.fr.design.actions.cell;
import com.fr.base.BaseUtils;
import com.fr.design.menu.KeySetUtils;
import com.fr.general.Inter;
@ -9,9 +10,9 @@ import com.fr.general.Inter;
public class CellAttributeAction extends CellAttributeTableAction {
public CellAttributeAction() {
this.setMenuKeySet(KeySetUtils.CELL_OTHER_ATTR);
this.setName(getMenuKeySet().getMenuKeySetName()+ "...");
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
// this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cellAttr.png"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cellAttr.png"));
}
@Override

2
designer/src/com/fr/design/actions/edit/HyperlinkAction.java

@ -17,7 +17,7 @@ public class HyperlinkAction extends UpdateAction {
public HyperlinkAction() {
this.setMenuKeySet(KeySetUtils.HYPER_LINK);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/hyperLink.png"));
}

33
designer/src/com/fr/grid/selection/CellSelection.java

@ -36,6 +36,7 @@ import com.fr.report.cell.cellattr.CellGUIAttr;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.ColumnRow;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.unit.FU;
import javax.swing.*;
@ -242,10 +243,10 @@ public class CellSelection extends Selection {
}
FU [] columnWidth = new FU[columnSpan];
FU [] rowHeight = new FU[rowSpan];
for(int i = 0; i < columnSpan; i++){
for (int i = 0; i < columnSpan; i++){
columnWidth[i] = ec.getColumnWidth(this.column + i);
}
for(int j = 0; j < rowSpan; j++){
for (int j = 0; j < rowSpan; j++){
rowHeight[j] = ec.getRowHeight(this.row + j);
}
transferable.addObject(new CellElementsClip(this.columnSpan, this.rowSpan, columnWidth, rowHeight, list.toArray(new TemplateCellElement[list.size()])));
@ -257,6 +258,7 @@ public class CellSelection extends Selection {
* @param ePane 区域
* @return 成功返回true
*/
@Override
public boolean pasteCellElementsClip(CellElementsClip ceClip, ElementCasePane ePane) {
TemplateElementCase ec = ePane.getEditingElementCase();
CellSelection cs = ceClip.pasteAt(ec, column, row);
@ -273,6 +275,7 @@ public class CellSelection extends Selection {
* @param ePane 区域
* @return 成功返回true
*/
@Override
public boolean pasteString(String str, ElementCasePane ePane) {
// 主要需要处理Excel当中的类型.
// Excel 的剪贴板格式
@ -297,7 +300,7 @@ public class CellSelection extends Selection {
ec.setCellValue(column + c, row + r, number);
} else {
// alex:对于100,000,000这种数值,先做一个取巧的解决方法
String newStr = Utils.replaceAllString(lineTextArray[c], ",", "");
String newStr = Utils.replaceAllString(lineTextArray[c], ",", StringUtils.EMPTY);
number = Utils.string2Number(newStr);
if (number != null) {
ec.setCellValue(column + c, row + r, Utils.string2Number(newStr));
@ -320,6 +323,7 @@ public class CellSelection extends Selection {
* @param ePane 区域
* @return 成功返回true
*/
@Override
public boolean pasteOtherType(Object ob, ElementCasePane ePane) {
TemplateElementCase ec = ePane.getEditingElementCase();
@ -341,6 +345,7 @@ public class CellSelection extends Selection {
* @param ePane 区域
* @return 是则返回true
*/
@Override
public boolean canMergeCells(ElementCasePane ePane) {
return !this.isSelectedOneCell(ePane);
@ -351,6 +356,7 @@ public class CellSelection extends Selection {
* @param ePane 区域
* @return 成功返回true
*/
@Override
public boolean mergeCells(ElementCasePane ePane) {
TemplateElementCase ec = ePane.getEditingElementCase();
@ -373,6 +379,7 @@ public class CellSelection extends Selection {
* @param ePane 区域
* @return 是则返回true
*/
@Override
public boolean canUnMergeCells(ElementCasePane ePane) {
TemplateElementCase ec = ePane.getEditingElementCase();
@ -393,6 +400,7 @@ public class CellSelection extends Selection {
* @param ePane 区域
* @return 成功返回true
*/
@Override
public boolean unMergeCells(ElementCasePane ePane) {
TemplateElementCase ec = ePane.getEditingElementCase();
@ -434,9 +442,10 @@ public class CellSelection extends Selection {
popup.add(new CleanAuthorityAction(ePane).createMenuItem());
return popup;
}
popup.add(DeprecatedActionManager.getCellMenu(ePane).createJMenu());
popup.add(new EditCellAction(ePane).createMenuItem());
popup.add(DeprecatedActionManager.getCellMenu(ePane).createJMenu());
// richer:add global style menu
popup.add(new CellExpandAttrAction().createMenuItem());
if (!ConfigManager.getProviderInstance().hasStyle()) {
UIMenu styleMenu = new UIMenu(KeySetUtils.GLOBAL_STYLE.getMenuName());
styleMenu.setIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cell.png"));
@ -455,13 +464,12 @@ public class CellSelection extends Selection {
} else {
popup.add(new StyleAction().createMenuItem());
}
popup.add(DeprecatedActionManager.getPresentMenu(ePane).createJMenu());
popup.add(new CellAttributeAction().createMenuItem());
JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (jTemplate.isJWorkBook()){ //表单中报表块编辑屏蔽掉 控件设置
popup.add(new CellWidgetAttrAction().createMenuItem());
}
popup.add(new CellExpandAttrAction().createMenuItem());
popup.add(DeprecatedActionManager.getPresentMenu(ePane).createJMenu());
popup.add(new CellAttributeAction().createMenuItem());
popup.add(new ConditionAttributesAction().createMenuItem());
popup.add(new HyperlinkAction().createMenuItem());
// cut, copy and paste
@ -483,17 +491,18 @@ public class CellSelection extends Selection {
* @param ePane 区域
* @return 成功返回true
*/
@Override
public boolean clear(Clear type, ElementCasePane ePane) {
TemplateElementCase ec = ePane.getEditingElementCase();
boolean isClear = true;
int cellRectangleCount = getCellRectangleCount();
for (int rect = 0; rect < cellRectangleCount; rect++) {
isClear = clearCell(type, ec, rect);
isClear = hasclearCell(type, ec, rect);
}
return isClear;
}
private boolean clearCell(Clear type, TemplateElementCase ec, int rect) {
private boolean hasclearCell(Clear type, TemplateElementCase ec, int rect) {
List<CellElement> removeElementList = new ArrayList<CellElement>();
Rectangle cellRectangle = getCellRectangle(rect);
column = cellRectangle.x;
@ -541,6 +550,8 @@ public class CellSelection extends Selection {
((TemplateCellElement) element).setWidget(null);
}
break;
default:
break;
}
return true;
}
@ -608,6 +619,7 @@ public class CellSelection extends Selection {
* @param ePane 区域
* @return 成功返回true
*/
@Override
public boolean triggerDeleteAction(ElementCasePane ePane) {
final TemplateElementCase ec = ePane.getEditingElementCase();
final RowColumnPane rcPane = new RowColumnPane();
@ -638,6 +650,7 @@ public class CellSelection extends Selection {
* @param cr 行列
* @return 包含返回true
*/
@Override
public boolean containsColumnRow(ColumnRow cr) {
return new Rectangle(column, row, columnSpan, rowSpan).contains(cr.column, cr.row);
}
@ -678,7 +691,7 @@ public class CellSelection extends Selection {
if (cellElement != null && b) {
value = cellElement.getValue();
}
value = value == null ? "" : value;
value = value == null ? StringUtils.EMPTY : value;
//之前是少了个bigInteger,刚kunsnat又发现少了个bigDecimal,数字类型的都用stringEditor,没必要那个样子
QuickEditor editor = ActionFactory.getCellEditor((value instanceof Number) ? (Number.class) : (value.getClass()));
if (editor == null) {

6
designer_base/src/com/fr/design/menu/KeySetUtils.java

@ -384,7 +384,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return "EXCEL"+Inter.getLocText("FR-Designer_ExportAndOutput");
return "EXCEL" + Inter.getLocText("FR-Designer_ExportAndOutput");
}
@Override
@ -756,7 +756,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("ExpandD-Cell_Expand_Attributes");
return Inter.getLocText("FR-Designer_Expand");
}
@Override
@ -978,7 +978,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("M_Format_A-Cell_Attributes");
return Inter.getLocText("FR-Designer_Other");
}
@Override

Loading…
Cancel
Save