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. 53
      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.Utils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.alphafine.AlphaFineConstants;
import com.fr.design.mainframe.alphafine.AlphaFineHelper;
import com.fr.design.mainframe.alphafine.CellType;
@ -233,8 +234,12 @@ public class RecentSearchManager extends XMLFileManager implements AlphaFineSear
SearchResult searchResult = new SearchResult();
while (modelIterator.hasNext()) {
AlphaCellModel model = modelIterator.next();
if (model.getType() == CellType.ACTION && !UpdateActionManager.getUpdateActionManager().isEnable(((ActionModel) model).getAction())) {
continue;
if (model.getType() == CellType.ACTION) {
UpdateAction action = UpdateActionManager.getUpdateActionManager().getActionByName(model.getName());
if (action != null) {
((ActionModel) model).setAction(action);
searchResult.add(model);
}
} else {
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.general.Inter;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
@ -29,6 +30,7 @@ import com.fr.stable.Nameable;
public class ConditionAttributesGroupPane extends UIListControlPane {
private static ConditionAttributesGroupPane singleton;
private TemplateCellElement editCellElement; // 当前单元格对象
private Selection editSelection; // 当前编辑对象
private ElementCasePane ePane;
private ConditionAttributesGroupPane() {
@ -52,10 +54,8 @@ public class ConditionAttributesGroupPane extends UIListControlPane {
if (isPopulating) {
return;
}
final CellSelection finalCS = (CellSelection) ePane.getSelection();
final TemplateElementCase tplEC = ePane.getEditingElementCase();
ReportActionUtils.actionIterateWithCellSelection(finalCS, tplEC, new ReportActionUtils.IterAction() {
ReportActionUtils.actionIterateWithCellSelection((CellSelection) editSelection, tplEC, new ReportActionUtils.IterAction() {
public void dealWith(CellElement editCellElement) {
((TemplateCellElement)editCellElement).setHighlightGroup(updateHighlightGroup());
}
@ -75,6 +75,7 @@ public class ConditionAttributesGroupPane extends UIListControlPane {
public void populate(ElementCasePane ePane) {
this.ePane = ePane;
this.editSelection = ePane.getSelection();
CellSelection cs = (CellSelection) ePane.getSelection();
final TemplateElementCase tplEC = ePane.getEditingElementCase();
editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow());

53
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.PluginEventType;
import com.fr.stable.ArrayUtils;
import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils;
import javax.swing.*;
@ -132,6 +131,9 @@ public abstract class ToolBarMenuDock {
};
private static final String FINEREPORT = "FineReport";
private static final int MENUBAR_HEIGHT = 22;
private static final List<PluginEventListener> PLUGIN_LISTENERS = new ArrayList<>();
private MenuDef[] menus;
private ToolBarDef toolBarDef;
private List<UpdateActionModel> shortCutsList;
@ -177,7 +179,6 @@ public abstract class ToolBarMenuDock {
return dim;
}
};
this.menus = menus(plus);
for (int i = 0; i < menus.length; i++) {
UIMenu subMenu = menus[i].createJMenu();
@ -201,6 +202,8 @@ public abstract class ToolBarMenuDock {
}
public MenuDef[] menus(final ToolBarMenuDockPlus plus) {
//删除之前创建的插件菜单监听
clearPluginListeners();
java.util.List<MenuDef> menuList = new java.util.ArrayList<MenuDef>();
// 添加文件菜单
menuList.add(createFileMenuDef(plus));
@ -230,7 +233,15 @@ public abstract class ToolBarMenuDock {
return menuList.toArray(new MenuDef[menuList.size()]);
}
private static synchronized void clearPluginListeners() {
for (PluginEventListener listener : PLUGIN_LISTENERS) {
GeneralContext.stopListenPlugin(listener);
}
PLUGIN_LISTENERS.clear();
}
/**
* 获取所有actionmodel
*
@ -602,9 +613,9 @@ public abstract class ToolBarMenuDock {
addExtraMenus(menuDef, anchor, action, set);
}
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() {
@Override
@ -613,29 +624,35 @@ public abstract class ToolBarMenuDock {
return context.contain(MenuHandler.MARK_STRING);
}
};
GeneralContext.listenPlugin(PluginEventType.BeforeStop, new PluginEventListener() {
PluginEventListener beforeStop = new PluginEventListener() {
@Override
public void on(PluginEvent event) {
PluginRuntime runtime = event.getContext().getRuntime();
Set<MenuHandler> menuHandlers = runtime.get(MenuHandler.MARK_STRING);
removeExtraMenus(menuDef, anchor, action, menuHandlers);
}
}, filter);
GeneralContext.listenPlugin(PluginEventType.AfterRun, new PluginEventListener() {
};
PluginEventListener afterRun = new PluginEventListener() {
@Override
public void on(PluginEvent event) {
PluginRuntime runtime = event.getContext().getRuntime();
Set<MenuHandler> menuHandlers = runtime.get(MenuHandler.MARK_STRING);
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<>();
@ -657,8 +674,8 @@ public abstract class ToolBarMenuDock {
menuDef.removeShortCut(shortCut);
}
}
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<>();
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;
}
public boolean isEnable(UpdateAction updateAction) {
/**
* 根据action name获取action对象
*
* @param name
* @return
*/
public UpdateAction getActionByName(String name) {
for (UpdateActionModel action : updateActions) {
if (ComparatorUtils.equals(updateAction.getName(), action.getActionName()) && action.getAction().isEnabled()) {
return true;
if (ComparatorUtils.equals(name, action.getActionName()) && action.getAction().isEnabled()) {
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 (state == WBodyLayoutType.FIT.getTypeValue()) {
return switch2FitBodyLayout();
} else {
XWFitLayout xfl = (XWFitLayout) xwAbsoluteLayout.getBackupParent();
if (xfl.toData().removeMargin()) {
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}
}
}
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);
Component[] components = xfl.getComponents();
xfl.removeAll();
xfl.toData().removeMargin();
XWAbsoluteBodyLayout xwAbsoluteBodyLayout = new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0));
xfl.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0);
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);
Component[] components = xWFitLayout.getComponents();
xWFitLayout.removeAll();
layout.resetStyle();
XWAbsoluteBodyLayout xwAbsoluteBodyLayout = new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0));
xWFitLayout.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0);
for (Component component : components) {

Loading…
Cancel
Save