Browse Source

Pull request #10310: REPORT-75998 更换菜单位置到“模板”

Merge in DESIGN/design from ~DESTINY.LIN/design:release/11.0 to release/11.0

* commit 'fe43d69d1f69a6a338fcbaed41b7f346b1c2a43b':
  REPORT-75998 更换菜单位置到“模板”
release/11.0
Destiny.Lin-林锦龙 2 years ago
parent
commit
e7a2ab3d32
  1. 5
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  2. 8
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  3. 18
      designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java
  4. BIN
      designer-base/src/main/resources/com/fr/design/images/replace/replace.png
  5. 3
      designer-base/src/main/resources/com/fr/design/images/replace/replace_normal.svg
  6. 1
      designer-realize/src/main/java/com/fr/design/actions/replace/ITReplaceAction.java

5
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -54,6 +54,7 @@ import com.fr.design.mainframe.toolbar.VcsScene;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.NameSeparator;
import com.fr.design.menu.ShortCut;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.preview.PagePreview;
import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.DesignUtils;
@ -1109,6 +1110,10 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
tplMenu.addShortCut(shortCuts4Authority());
}
//查找替换
tplMenu.addShortCut(new NameSeparator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Replace_Name_Separate")));
tplMenu.addShortCut((ShortCut) DesignModuleFactory.getITReplaceAction());
return new MenuDef[]{tplMenu};
}

8
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -580,13 +580,7 @@ public abstract class ToolBarMenuDock {
}
shortCuts.add(new AboutAction());
try {
if (DesignModuleFactory.getITReplaceAction() != null) {
shortCuts.add((ShortCut) DesignModuleFactory.getITReplaceAction().newInstance());
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return shortCuts.toArray(new ShortCut[0]);
}

18
designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java

@ -19,6 +19,7 @@ import com.fr.log.FineLoggerFactory;
import com.fr.plugin.solution.sandbox.collection.PluginSandboxCollections;
import com.fr.stable.StableUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.lang.reflect.Constructor;
import java.awt.Dialog;
@ -129,8 +130,21 @@ public class DesignModuleFactory {
instance.ITReplaceAction = r;
}
public static Class getITReplaceAction() {
return instance.ITReplaceAction;
/**
* 获取查找替换
*
* @return ITReplaceAction
*/
@Nullable
public static Object getITReplaceAction() {
try {
if (instance.ITReplaceAction != null) {
return instance.ITReplaceAction.newInstance();
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return null;
}
/**

BIN
designer-base/src/main/resources/com/fr/design/images/replace/replace.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 418 B

3
designer-base/src/main/resources/com/fr/design/images/replace/replace_normal.svg

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.90857 12.5269C3.871 12.5269 1.40857 10.0644 1.40857 7.02686C1.40857 3.98929 3.871 1.52686 6.90857 1.52686C9.94614 1.52686 12.4086 3.98929 12.4086 7.02686C12.4086 8.28787 11.9842 9.44977 11.2705 10.3775L14.3701 13.5236C14.6528 13.8062 14.6528 14.2645 14.3701 14.5472C14.0874 14.8298 13.6292 14.8298 13.3465 14.5472L10.2452 11.3995C9.31981 12.1067 8.16326 12.5269 6.90857 12.5269ZM11.4086 7.02686C11.4086 9.51214 9.39385 11.5269 6.90857 11.5269C4.42329 11.5269 2.40857 9.51214 2.40857 7.02686C2.40857 4.54157 4.42329 2.52686 6.90857 2.52686C9.39385 2.52686 11.4086 4.54157 11.4086 7.02686Z" fill="#333334"/>
</svg>

After

Width:  |  Height:  |  Size: 761 B

1
designer-realize/src/main/java/com/fr/design/actions/replace/ITReplaceAction.java

@ -29,6 +29,7 @@ public class ITReplaceAction extends UpdateAction {
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setAccelerator(getMenuKeySet().getKeyStroke());
this.setSmallIcon("/com/fr/design/images/replace/replace");
}
private static final MenuKeySet IT_REPLACE = new MenuKeySet() {

Loading…
Cancel
Save