Carlson
2 years ago
13 changed files with 246 additions and 32 deletions
@ -0,0 +1,30 @@ |
|||||||
|
package com.fr.design.mainframe.platform; |
||||||
|
|
||||||
|
import com.fr.design.actions.UpdateAction; |
||||||
|
import com.fr.design.i18n.Toolkit; |
||||||
|
import com.fr.design.utils.BrowseUtils; |
||||||
|
import com.fr.general.CloudCenter; |
||||||
|
import com.fr.log.FineLoggerFactory; |
||||||
|
|
||||||
|
import java.awt.Desktop; |
||||||
|
import java.awt.event.ActionEvent; |
||||||
|
import java.net.URI; |
||||||
|
|
||||||
|
/** |
||||||
|
* 帮助-服务平台 |
||||||
|
* |
||||||
|
* @author Destiny.Lin |
||||||
|
* @version 11.0 |
||||||
|
* created by Destiny.Lin on 2022-12-14 |
||||||
|
*/ |
||||||
|
public class ServicePlatformAction extends UpdateAction { |
||||||
|
public ServicePlatformAction() { |
||||||
|
this.setName(Toolkit.i18nText("Fine-Design_Basic_Service_Platform_Title")); |
||||||
|
this.setSmallIcon("/com/fr/design/images/platform/platform"); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void actionPerformed(ActionEvent e) { |
||||||
|
BrowseUtils.browser(CloudCenter.getInstance().acquireUrlByKind("service.platform")); |
||||||
|
} |
||||||
|
} |
After Width: | Height: | Size: 458 B |
@ -0,0 +1,18 @@ |
|||||||
|
package com.fr.design.designer.beans.models; |
||||||
|
|
||||||
|
public interface ClipboardProvider { |
||||||
|
|
||||||
|
/** |
||||||
|
* 剪切到剪贴板 |
||||||
|
* |
||||||
|
* @param o 剪切对象 |
||||||
|
*/ |
||||||
|
void cut2Clipboard(Object o); |
||||||
|
|
||||||
|
/** |
||||||
|
* 复制到剪贴板 |
||||||
|
* |
||||||
|
* @param o 复制对象 |
||||||
|
*/ |
||||||
|
void copy2Clipboard(Object o); |
||||||
|
} |
@ -0,0 +1,45 @@ |
|||||||
|
package com.fr.design.designer.beans.models; |
||||||
|
|
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* 用来管理不同剪贴板,以及之间的数据同步 |
||||||
|
*/ |
||||||
|
public class DashboardClipboardManager { |
||||||
|
private static class Holder { |
||||||
|
private static final DashboardClipboardManager HOLDER = new DashboardClipboardManager(); |
||||||
|
} |
||||||
|
|
||||||
|
private static final List<ClipboardProvider> CLIPBOARD_LIST = new ArrayList<>(); |
||||||
|
|
||||||
|
|
||||||
|
public void registerDashboardClipboard(ClipboardProvider clipboard) { |
||||||
|
CLIPBOARD_LIST.add(clipboard); |
||||||
|
} |
||||||
|
|
||||||
|
public void removeDashboardClipboard(ClipboardProvider clipboard) { |
||||||
|
CLIPBOARD_LIST.remove(clipboard); |
||||||
|
} |
||||||
|
|
||||||
|
public static DashboardClipboardManager getInstance() { |
||||||
|
return Holder.HOLDER; |
||||||
|
} |
||||||
|
|
||||||
|
private DashboardClipboardManager() { |
||||||
|
} |
||||||
|
|
||||||
|
public void cut2Clipboard(Object o) { |
||||||
|
for (ClipboardProvider clipboard : CLIPBOARD_LIST) { |
||||||
|
//同步其他剪贴板
|
||||||
|
clipboard.cut2Clipboard(o); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public void copy2Clipboard(Object o) { |
||||||
|
for (ClipboardProvider clipboard : CLIPBOARD_LIST) { |
||||||
|
//同步其他剪贴板
|
||||||
|
clipboard.copy2Clipboard(o); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,45 @@ |
|||||||
|
package com.fr.design.designer.beans.models; |
||||||
|
|
||||||
|
import com.fr.design.mainframe.FormSelection; |
||||||
|
|
||||||
|
public class FormSelectionClipboard implements ClipboardProvider { |
||||||
|
private static final FormSelection FRM_CLIPBOARD = new FormSelection(); |
||||||
|
|
||||||
|
static { |
||||||
|
DashboardClipboardManager.getInstance().registerDashboardClipboard(FormSelectionClipboard.getInstance()); |
||||||
|
} |
||||||
|
|
||||||
|
private static class Holder { |
||||||
|
private static final FormSelectionClipboard HOLDER = new FormSelectionClipboard(); |
||||||
|
} |
||||||
|
|
||||||
|
public static FormSelectionClipboard getInstance() { |
||||||
|
return Holder.HOLDER; |
||||||
|
} |
||||||
|
|
||||||
|
private FormSelectionClipboard() { |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
public boolean isEmpty() { |
||||||
|
return FRM_CLIPBOARD.isEmpty(); |
||||||
|
} |
||||||
|
|
||||||
|
public FormSelection getClipboard() { |
||||||
|
return FRM_CLIPBOARD; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void cut2Clipboard(Object o) { |
||||||
|
if (o instanceof FormSelection) { |
||||||
|
((FormSelection) o).cut2ClipBoard(FRM_CLIPBOARD); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void copy2Clipboard(Object o) { |
||||||
|
if (o instanceof FormSelection) { |
||||||
|
((FormSelection) o).copy2ClipBoard(FRM_CLIPBOARD); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue