Browse Source

Merge branch 'release/9.0' of http://cloud.finedevelop.com:2015/scm/~kerry/design into release/9.0

kerry 8 years ago
parent
commit
1e81c34af9
  1. 9
      designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java
  2. 7
      designer/src/com/fr/design/present/ConditionAttributesGroupPane.java
  3. 35
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  4. 14
      designer_base/src/com/fr/design/mainframe/toolbar/UpdateActionManager.java
  5. 5
      designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java
  6. 1
      designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java
  7. 1
      designer_form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java

9
designer/src/com/fr/design/mainframe/alphafine/search/manager/RecentSearchManager.java

@ -2,6 +2,7 @@ package com.fr.design.mainframe.alphafine.search.manager;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.AlphaFineHelper;
import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.CellType;
@ -233,8 +234,12 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear
SearchResult searchResult = new SearchResult(); SearchResult searchResult = new SearchResult();
while (modelIterator.hasNext()) { while (modelIterator.hasNext()) {
AlphaCellModel model = modelIterator.next(); AlphaCellModel model = modelIterator.next();
if (model.getType() == CellType.ACTION && !UpdateActionManager.getUpdateActionManager().isEnable(((ActionModel) model).getAction())) { if (model.getType() == CellType.ACTION) {
continue; UpdateAction action = UpdateActionManager.getUpdateActionManager().getActionByName(model.getName());
if (action != null) {
((ActionModel) model).setAction(action);
searchResult.add(model);
}
} else { } else {
searchResult.add(model); searchResult.add(model);
} }

7
designer/src/com/fr/design/present/ConditionAttributesGroupPane.java

@ -16,6 +16,7 @@ import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.cell.CellElement; import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
@ -29,6 +30,7 @@ import com.fr.stable.Nameable;
public class ConditionAttributesGroupPane extends UIListControlPane { public class ConditionAttributesGroupPane extends UIListControlPane {
private static ConditionAttributesGroupPane singleton; private static ConditionAttributesGroupPane singleton;
private TemplateCellElement editCellElement; // 当前单元格对象 private TemplateCellElement editCellElement; // 当前单元格对象
private Selection editSelection; // 当前编辑对象
private ElementCasePane ePane; private ElementCasePane ePane;
private ConditionAttributesGroupPane() { private ConditionAttributesGroupPane() {
@ -52,10 +54,8 @@ public class ConditionAttributesGroupPane extends UIListControlPane {
if (isPopulating) { if (isPopulating) {
return; return;
} }
final CellSelection finalCS = (CellSelection) ePane.getSelection();
final TemplateElementCase tplEC = ePane.getEditingElementCase(); final TemplateElementCase tplEC = ePane.getEditingElementCase();
ReportActionUtils.actionIterateWithCellSelection((CellSelection) editSelection, tplEC, new ReportActionUtils.IterAction() {
ReportActionUtils.actionIterateWithCellSelection(finalCS, tplEC, new ReportActionUtils.IterAction() {
public void dealWith(CellElement editCellElement) { public void dealWith(CellElement editCellElement) {
((TemplateCellElement)editCellElement).setHighlightGroup(updateHighlightGroup()); ((TemplateCellElement)editCellElement).setHighlightGroup(updateHighlightGroup());
} }
@ -75,6 +75,7 @@ public class ConditionAttributesGroupPane extends UIListControlPane {
public void populate(ElementCasePane ePane) { public void populate(ElementCasePane ePane) {
this.ePane = ePane; this.ePane = ePane;
this.editSelection = ePane.getSelection();
CellSelection cs = (CellSelection) ePane.getSelection(); CellSelection cs = (CellSelection) ePane.getSelection();
final TemplateElementCase tplEC = ePane.getEditingElementCase(); final TemplateElementCase tplEC = ePane.getEditingElementCase();
editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow()); editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow());

35
designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -58,7 +58,6 @@ import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.observer.PluginEventType; import com.fr.plugin.observer.PluginEventType;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
@ -132,6 +131,9 @@ public abstract class ToolBarMenuDock {
}; };
private static final String FINEREPORT = "FineReport"; private static final String FINEREPORT = "FineReport";
private static final int MENUBAR_HEIGHT = 22; private static final int MENUBAR_HEIGHT = 22;
private static final List<PluginEventListener> PLUGIN_LISTENERS = new ArrayList<>();
private MenuDef[] menus; private MenuDef[] menus;
private ToolBarDef toolBarDef; private ToolBarDef toolBarDef;
private List<UpdateActionModel> shortCutsList; private List<UpdateActionModel> shortCutsList;
@ -177,7 +179,6 @@ public abstract class ToolBarMenuDock {
return dim; return dim;
} }
}; };
this.menus = menus(plus); this.menus = menus(plus);
for (int i = 0; i < menus.length; i++) { for (int i = 0; i < menus.length; i++) {
UIMenu subMenu = menus[i].createJMenu(); UIMenu subMenu = menus[i].createJMenu();
@ -201,6 +202,8 @@ public abstract class ToolBarMenuDock {
} }
public MenuDef[] menus(final ToolBarMenuDockPlus plus) { public MenuDef[] menus(final ToolBarMenuDockPlus plus) {
//删除之前创建的插件菜单监听
clearPluginListeners();
java.util.List<MenuDef> menuList = new java.util.ArrayList<MenuDef>(); java.util.List<MenuDef> menuList = new java.util.ArrayList<MenuDef>();
// 添加文件菜单 // 添加文件菜单
menuList.add(createFileMenuDef(plus)); menuList.add(createFileMenuDef(plus));
@ -231,6 +234,14 @@ public abstract class ToolBarMenuDock {
return menuList.toArray(new MenuDef[menuList.size()]); return menuList.toArray(new MenuDef[menuList.size()]);
} }
private static synchronized void clearPluginListeners() {
for (PluginEventListener listener : PLUGIN_LISTENERS) {
GeneralContext.stopListenPlugin(listener);
}
PLUGIN_LISTENERS.clear();
}
/** /**
* 获取所有actionmodel * 获取所有actionmodel
* *
@ -603,7 +614,7 @@ public abstract class ToolBarMenuDock {
} }
private void listenPluginMenuChange(final MenuDef menuDef, final String anchor, final ShortCutMethodAction action) { private static synchronized void listenPluginMenuChange(final MenuDef menuDef, final String anchor, final ShortCutMethodAction action) {
PluginFilter filter = new PluginFilter() { PluginFilter filter = new PluginFilter() {
@ -614,7 +625,7 @@ public abstract class ToolBarMenuDock {
} }
}; };
GeneralContext.listenPlugin(PluginEventType.BeforeStop, new PluginEventListener() { PluginEventListener beforeStop = new PluginEventListener() {
@Override @Override
public void on(PluginEvent event) { public void on(PluginEvent event) {
@ -622,8 +633,9 @@ public abstract class ToolBarMenuDock {
Set<MenuHandler> menuHandlers = runtime.get(MenuHandler.MARK_STRING); Set<MenuHandler> menuHandlers = runtime.get(MenuHandler.MARK_STRING);
removeExtraMenus(menuDef, anchor, action, menuHandlers); removeExtraMenus(menuDef, anchor, action, menuHandlers);
} }
}, filter); };
GeneralContext.listenPlugin(PluginEventType.AfterRun, new PluginEventListener() {
PluginEventListener afterRun = new PluginEventListener() {
@Override @Override
public void on(PluginEvent event) { public void on(PluginEvent event) {
@ -632,10 +644,15 @@ public abstract class ToolBarMenuDock {
Set<MenuHandler> menuHandlers = runtime.get(MenuHandler.MARK_STRING); Set<MenuHandler> menuHandlers = runtime.get(MenuHandler.MARK_STRING);
addExtraMenus(menuDef, anchor, action, menuHandlers); addExtraMenus(menuDef, anchor, action, menuHandlers);
} }
}, filter); };
GeneralContext.listenPlugin(PluginEventType.BeforeStop, beforeStop, filter);
GeneralContext.listenPlugin(PluginEventType.AfterRun, afterRun, filter);
PLUGIN_LISTENERS.add(afterRun);
PLUGIN_LISTENERS.add(beforeStop);
} }
private void removeExtraMenus(MenuDef menuDef, String anchor, ShortCutMethodAction action, Set<MenuHandler> set) { private static void removeExtraMenus(MenuDef menuDef, String anchor, ShortCutMethodAction action, Set<MenuHandler> set) {
List<MenuHandler> target = new ArrayList<>(); List<MenuHandler> target = new ArrayList<>();
@ -658,7 +675,7 @@ public abstract class ToolBarMenuDock {
} }
} }
private void addExtraMenus(MenuDef menuDef, String anchor, ShortCutMethodAction action, Set<MenuHandler> set) { private static void addExtraMenus(MenuDef menuDef, String anchor, ShortCutMethodAction action, Set<MenuHandler> set) {
List<MenuHandler> target = new ArrayList<>(); List<MenuHandler> target = new ArrayList<>();
for (MenuHandler handler : set) { for (MenuHandler handler : set) {

14
designer_base/src/com/fr/design/mainframe/toolbar/UpdateActionManager.java

@ -27,12 +27,18 @@ public class UpdateActionManager {
this.updateActions = updateActions; this.updateActions = updateActions;
} }
public boolean isEnable(UpdateAction updateAction) { /**
* 根据action name获取action对象
*
* @param name
* @return
*/
public UpdateAction getActionByName(String name) {
for (UpdateActionModel action : updateActions) { for (UpdateActionModel action : updateActions) {
if (ComparatorUtils.equals(updateAction.getName(), action.getActionName()) && action.getAction().isEnabled()) { if (ComparatorUtils.equals(name, action.getActionName()) && action.getAction().isEnabled()) {
return true; return action.getAction();
} }
} }
return false; return null;
} }
} }

5
designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java

@ -98,11 +98,6 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr
if (row == 0) { if (row == 0) {
if (state == WBodyLayoutType.FIT.getTypeValue()) { if (state == WBodyLayoutType.FIT.getTypeValue()) {
return switch2FitBodyLayout(); return switch2FitBodyLayout();
} else {
XWFitLayout xfl = (XWFitLayout) xwAbsoluteLayout.getBackupParent();
if (xfl.toData().removeMargin()) {
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}
} }
} }
if (row == 1) { if (row == 1) {

1
designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java

@ -152,7 +152,6 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
wAbsoluteBodyLayout.setCompState(WAbsoluteLayout.STATE_FIXED); wAbsoluteBodyLayout.setCompState(WAbsoluteLayout.STATE_FIXED);
Component[] components = xfl.getComponents(); Component[] components = xfl.getComponents();
xfl.removeAll(); xfl.removeAll();
xfl.toData().removeMargin();
XWAbsoluteBodyLayout xwAbsoluteBodyLayout = new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0)); XWAbsoluteBodyLayout xwAbsoluteBodyLayout = new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0));
xfl.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0); xfl.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0);
for (Component component : components) { for (Component component : components) {

1
designer_form/src/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java

@ -161,6 +161,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
wAbsoluteBodyLayout.setCompState(WAbsoluteLayout.STATE_FIXED); wAbsoluteBodyLayout.setCompState(WAbsoluteLayout.STATE_FIXED);
Component[] components = xWFitLayout.getComponents(); Component[] components = xWFitLayout.getComponents();
xWFitLayout.removeAll(); xWFitLayout.removeAll();
layout.resetStyle();
XWAbsoluteBodyLayout xwAbsoluteBodyLayout = new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0)); XWAbsoluteBodyLayout xwAbsoluteBodyLayout = new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0));
xWFitLayout.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0); xWFitLayout.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0);
for (Component component : components) { for (Component component : components) {

Loading…
Cancel
Save