功能分类,代码优化
This commit is contained in:
+1
-1
@@ -19,4 +19,4 @@ if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
rootProject.name = "Idea-Plugin"
|
rootProject.name = "Huangzhijun-Idea-Plugin"
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,29 @@
|
|||||||
|
package com.huangzj.protoplugin.devtools;
|
||||||
|
|
||||||
|
import com.intellij.openapi.project.Project;
|
||||||
|
import com.intellij.openapi.wm.ToolWindow;
|
||||||
|
import com.intellij.openapi.wm.ToolWindowFactory;
|
||||||
|
import com.intellij.openapi.wm.ex.ToolWindowEx;
|
||||||
|
import com.intellij.ui.content.ContentFactory;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
public final class DevToolsToolWindowFactory implements ToolWindowFactory {
|
||||||
|
|
||||||
|
public static final String TOOL_WINDOW_ID = "DevTools";
|
||||||
|
|
||||||
|
public static final String TOOL_WINDOW_STRIPE_TITLE = "开发者工具";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(@NotNull ToolWindow toolWindow) {
|
||||||
|
if (toolWindow instanceof ToolWindowEx ex) {
|
||||||
|
ex.setStripeTitle(TOOL_WINDOW_STRIPE_TITLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
|
||||||
|
DevToolsPanel panel = new DevToolsPanel();
|
||||||
|
var content = ContentFactory.getInstance().createContent(panel, TOOL_WINDOW_STRIPE_TITLE, false);
|
||||||
|
toolWindow.getContentManager().addContent(content);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
package com.huangzj.protoplugin.memo;
|
package com.huangzj.protoplugin.memo;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/** 备忘录条目(字段需可被持久化组件序列化)。 */
|
|
||||||
public class MemoItem {
|
public class MemoItem {
|
||||||
|
|
||||||
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||||
@@ -12,6 +13,8 @@ public class MemoItem {
|
|||||||
public String title = "";
|
public String title = "";
|
||||||
public String content = "";
|
public String content = "";
|
||||||
public long updated = 0L;
|
public long updated = 0L;
|
||||||
|
public boolean pinned = false;
|
||||||
|
public List<String> tags = new ArrayList<>();
|
||||||
|
|
||||||
public MemoItem() {}
|
public MemoItem() {}
|
||||||
|
|
||||||
@@ -48,4 +51,11 @@ public class MemoItem {
|
|||||||
}
|
}
|
||||||
return firstLine;
|
return firstLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String tagsDisplay() {
|
||||||
|
if (tags == null || tags.isEmpty()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return String.join(", ", tags);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -22,6 +22,11 @@
|
|||||||
anchor="right"
|
anchor="right"
|
||||||
secondary="true"
|
secondary="true"
|
||||||
canCloseContents="false"/>
|
canCloseContents="false"/>
|
||||||
|
<toolWindow id="DevTools"
|
||||||
|
factoryClass="com.huangzj.protoplugin.devtools.DevToolsToolWindowFactory"
|
||||||
|
anchor="right"
|
||||||
|
secondary="true"
|
||||||
|
canCloseContents="false"/>
|
||||||
<intentionAction>
|
<intentionAction>
|
||||||
<language>JAVA</language>
|
<language>JAVA</language>
|
||||||
<className>com.huangzj.protoplugin.json.ClassToJsonIntention</className>
|
<className>com.huangzj.protoplugin.json.ClassToJsonIntention</className>
|
||||||
|
|||||||
Reference in New Issue
Block a user