diff --git a/src/intellij_plugin/ohosgen/.idea/.name b/src/intellij_plugin/ohosgen/.idea/.name
new file mode 100644
index 0000000000000000000000000000000000000000..64160aad5e0aadfb1821207a93f0ef4be10f4f55
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/.idea/.name
@@ -0,0 +1 @@
+plugtest
\ No newline at end of file
diff --git a/src/intellij_plugin/ohosgen/.idea/codeStyles/codeStyleConfig.xml b/src/intellij_plugin/ohosgen/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 0000000000000000000000000000000000000000..a55e7a179bde3e4e772c29c0c85e53354aa54618
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/intellij_plugin/ohosgen/.idea/gradle.xml b/src/intellij_plugin/ohosgen/.idea/gradle.xml
new file mode 100644
index 0000000000000000000000000000000000000000..ce1c62c7c60561be6b5a9bc9f115e8966e9e5a4a
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/.idea/gradle.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/intellij_plugin/ohosgen/.idea/kotlinc.xml b/src/intellij_plugin/ohosgen/.idea/kotlinc.xml
new file mode 100644
index 0000000000000000000000000000000000000000..4cb745724991053f20f0b3afacf4017c4ac4e5a7
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/.idea/kotlinc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/intellij_plugin/ohosgen/.idea/misc.xml b/src/intellij_plugin/ohosgen/.idea/misc.xml
new file mode 100644
index 0000000000000000000000000000000000000000..276827d3f2c724142cab6ee6102d8718fba692e3
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/.idea/misc.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/intellij_plugin/ohosgen/.idea/vcs.xml b/src/intellij_plugin/ohosgen/.idea/vcs.xml
new file mode 100644
index 0000000000000000000000000000000000000000..c2365ab11f9ba6b763735c8fd976420234bb3521
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/intellij_plugin/ohosgen/.run/Run IDE with Plugin.run.xml b/src/intellij_plugin/ohosgen/.run/Run IDE with Plugin.run.xml
new file mode 100644
index 0000000000000000000000000000000000000000..7747a294009ca902b7463f9ce7c2ac12d10135d2
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/.run/Run IDE with Plugin.run.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+ * description ${description}
+ *
+ * @author ${USER}
+ * date 2025-02-28
+ * @since 2025-02-28
+ * @version 1.0
+ */
+public class Dts2cpp extends AnAction {
+
+ private void showProgress(@NotNull AnActionEvent e) {
+ Project project = e.getProject();
+ // 获取当前选中的文件
+ VirtualFile file = e.getDataContext().getData(CommonDataKeys.VIRTUAL_FILE);
+ if (file != null && file.getExtension() != null && file.getExtension().equals("ts")) {
+ // 如果是 .java 文件,执行任务
+ doProgress(project, file);
+ }
+ }
+
+ private void doProgress(Project project, VirtualFile file) {
+ ProgressManager.getInstance().run(new MockBgTask(project, "Processing File", true));
+ }
+
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ // NEEDO: insert action logic here
+ showProgress(e);
+ }
+
+ @Override
+ public void update(AnActionEvent e) {
+ // 获取当前选中的文件
+ VirtualFile file = e.getDataContext().getData(CommonDataKeys.VIRTUAL_FILE);
+ if (file != null && file.getExtension() != null) {
+ if (file.getExtension().equals("ts")) {
+ // 如果是 .java 文件,显示 Action
+ e.getPresentation().setEnabledAndVisible(true);
+ } else {
+ // 否则隐藏 Action
+ e.getPresentation().setEnabledAndVisible(false);
+ }
+ } else {
+ // 否则隐藏 Action
+ e.getPresentation().setEnabledAndVisible(false);
+ }
+ }
+}
diff --git a/src/intellij_plugin/ohosgen/src/main/java/H2dtsAction.java b/src/intellij_plugin/ohosgen/src/main/java/H2dtsAction.java
new file mode 100644
index 0000000000000000000000000000000000000000..72d7ac9580bab4a4d6d5d97cb87f4590780f5807
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/src/main/java/H2dtsAction.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.CommonDataKeys;
+import com.intellij.openapi.progress.ProgressIndicator;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.progress.Task;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.vfs.VirtualFile;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ *
类名:该类用于xxx
+ * description ${description}
+ *
+ * @author ${USER}
+ * date 2025-02-28
+ * @since 2025-02-28
+ * @version 1.0
+ */
+public class H2dtsAction extends AnAction {
+
+ private void showProgress(AnActionEvent e) {
+ Project project = e.getProject();
+ // 获取当前选中的文件
+ VirtualFile file = e.getDataContext().getData(CommonDataKeys.VIRTUAL_FILE);
+ if (file != null && file.getExtension() != null && file.getExtension().equals("h")) {
+ // 如果是 .java 文件,执行任务
+ doProgress(project);
+ }
+ }
+
+ private void doSleep() {
+ try {
+ Thread.sleep(500); // 模拟耗时操作
+ } catch (InterruptedException ex) {
+ System.out.println("thread exception ex.printStackTrace();");
+ }
+ }
+ private void doProgress(Project project) {
+ ProgressManager.getInstance().run(new Task.Backgroundable(project, "Processing File", true) {
+ @Override
+ public void run(@NotNull ProgressIndicator indicator) {
+ indicator.setFraction(0.0);
+ for (int i = 0; i < 10; i++) {
+ indicator.setFraction((i + 1) / 10.0);
+ indicator.setText("Processing step " + (i + 1));
+ doSleep();
+ }
+ Messages.showInfoMessage("File processing complete!", "Main Action");
+ }
+ });
+ }
+
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ // NEEDO: insert action logic here
+ showProgress(e);
+ }
+
+ @Override
+ public void update(AnActionEvent e) {
+ // 获取当前选中的文件
+ VirtualFile file = e.getDataContext().getData(CommonDataKeys.VIRTUAL_FILE);
+ if (file != null && file.getExtension() != null) {
+ if (file.getExtension().equals("h")) {
+ // 如果是 .java 文件,显示 Action
+ e.getPresentation().setEnabledAndVisible(true);
+ } else {
+ // 否则隐藏 Action
+ e.getPresentation().setEnabledAndVisible(false);
+ }
+ } else {
+ // 否则隐藏 Action
+ e.getPresentation().setEnabledAndVisible(false);
+ }
+ }
+}
diff --git a/src/intellij_plugin/ohosgen/src/main/java/H2dtscppAction.java b/src/intellij_plugin/ohosgen/src/main/java/H2dtscppAction.java
new file mode 100644
index 0000000000000000000000000000000000000000..c6e4d73ab611c403f0b8c393824ae0a4f9b58f7d
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/src/main/java/H2dtscppAction.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2025 Shenzhen Kaihong Digital.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.CommonDataKeys;
+import com.intellij.openapi.progress.ProgressIndicator;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.progress.Task;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.vfs.VirtualFile;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ *
类名:该类用于xxx
+ * description ${description}
+ *
+ * @author ${USER}
+ * date 2025-02-28
+ * @since 2025-02-28
+ * @version 1.0
+ */
+public class H2dtscppAction extends AnAction {
+
+ private void showProgress(AnActionEvent e) {
+ Project project = e.getProject();
+ // 获取当前选中的文件
+ VirtualFile file = e.getDataContext().getData(CommonDataKeys.VIRTUAL_FILE);
+ if (file != null && file.getExtension() != null && file.getExtension().equals("h")) {
+ // 如果是 .java 文件,执行任务
+ doProgress(project);
+ }
+ }
+
+ private void doSleep() {
+ try {
+ Thread.sleep(500); // 模拟耗时操作
+ } catch (InterruptedException ex) {
+ System.out.println("thread exception ex.printStackTrace();");
+ }
+ }
+ private void doProgress(Project project) {
+ ProgressManager.getInstance().run(new Task.Backgroundable(project, "Processing File", true) {
+ @Override
+ public void run(@NotNull ProgressIndicator indicator) {
+ indicator.setFraction(0.0);
+ for (int i = 0; i < 10; i++) {
+ indicator.setFraction((i + 1) / 10.0);
+ indicator.setText("Processing step " + (i + 1));
+ doSleep();
+ }
+ Messages.showInfoMessage("File processing complete!", "Main Action");
+ }
+ });
+ }
+
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ // NEEDO: insert action logic here
+ showProgress(e);
+ }
+
+ @Override
+ public void update(AnActionEvent e) {
+ // 获取当前选中的文件
+ VirtualFile file = e.getDataContext().getData(CommonDataKeys.VIRTUAL_FILE);
+ if (file != null && file.getExtension() != null) {
+ if (file.getExtension().equals("h")) {
+ // 如果是 .java 文件,显示 Action
+ e.getPresentation().setEnabledAndVisible(true);
+ } else {
+ // 否则隐藏 Action
+ e.getPresentation().setEnabledAndVisible(false);
+ }
+ } else {
+ // 否则隐藏 Action
+ e.getPresentation().setEnabledAndVisible(false);
+ }
+ }
+}
diff --git a/src/intellij_plugin/ohosgen/src/main/java/H2hdf.java b/src/intellij_plugin/ohosgen/src/main/java/H2hdf.java
new file mode 100644
index 0000000000000000000000000000000000000000..f19ed3213d68b2c7a5b855e262b9005c0446a893
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/src/main/java/H2hdf.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2025 Shenzhen Kaihong Digital.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.CommonDataKeys;
+import com.intellij.openapi.progress.ProgressIndicator;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.progress.Task;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.vfs.VirtualFile;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ *
类名:该类用于xxx
+ * description ${description}
+ *
+ * @author ${USER}
+ * date 2025-02-28
+ * @since 2025-02-28
+ * @version 1.0
+ */
+public class H2hdf extends AnAction {
+
+ private void showProgress(AnActionEvent e) {
+ Project project = e.getProject();
+ // 获取当前选中的文件
+ VirtualFile file = e.getDataContext().getData(CommonDataKeys.VIRTUAL_FILE);
+ if (file != null && file.getExtension() != null && file.getExtension().equals("h")) {
+ // 如果是 .java 文件,执行任务
+ doProgress(project);
+ }
+ }
+
+ private void doSleep() {
+ try {
+ Thread.sleep(500); // 模拟耗时操作
+ } catch (InterruptedException ex) {
+ System.out.println("thread exception ex.printStackTrace();");
+ }
+ }
+ private void doProgress(Project project) {
+ ProgressManager.getInstance().run(new Task.Backgroundable(project, "Processing File", true) {
+ @Override
+ public void run(@NotNull ProgressIndicator indicator) {
+ indicator.setFraction(0.0);
+ for (int i = 0; i < 10; i++) {
+ indicator.setFraction((i + 1) / 10.0);
+ indicator.setText("Processing step " + (i + 1));
+ doSleep();
+ }
+ Messages.showInfoMessage("File processing complete!", "Main Action");
+ }
+ });
+ }
+
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ // NEEDO: insert action logic here
+ showProgress(e);
+ }
+
+ @Override
+ public void update(AnActionEvent e) {
+ // 获取当前选中的文件
+ VirtualFile file = e.getDataContext().getData(CommonDataKeys.VIRTUAL_FILE);
+ if (file != null && file.getExtension() != null) {
+ if (file.getExtension().equals("h")) {
+ // 如果是 .java 文件,显示 Action
+ e.getPresentation().setEnabledAndVisible(true);
+ } else {
+ // 否则隐藏 Action
+ e.getPresentation().setEnabledAndVisible(false);
+ }
+ } else {
+ // 否则隐藏 Action
+ e.getPresentation().setEnabledAndVisible(false);
+ }
+ }
+}
diff --git a/src/intellij_plugin/ohosgen/src/main/java/H2sa.java b/src/intellij_plugin/ohosgen/src/main/java/H2sa.java
new file mode 100644
index 0000000000000000000000000000000000000000..dfb92c22ffecac3a5d524df3e61f9e8d2fbf6980
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/src/main/java/H2sa.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2025 Shenzhen Kaihong Digital.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.CommonDataKeys;
+import com.intellij.openapi.progress.ProgressIndicator;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.progress.Task;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.vfs.VirtualFile;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ *
类名:该类用于xxx
+ * description ${description}
+ *
+ * @author ${USER}
+ * date 2025-02-28
+ * @since 2025-02-28
+ * @version 1.0
+ */
+public class H2sa extends AnAction {
+
+ private void showProgress(AnActionEvent e) {
+ Project project = e.getProject();
+ // 获取当前选中的文件
+ VirtualFile file = e.getDataContext().getData(CommonDataKeys.VIRTUAL_FILE);
+ if (file != null && file.getExtension() != null && file.getExtension().equals("h")) {
+ // 如果是 .java 文件,执行任务
+ doProgress(project);
+ }
+ }
+
+ private void doSleep() {
+ try {
+ Thread.sleep(500); // 模拟耗时操作
+ } catch (InterruptedException ex) {
+ System.out.println("thread exception ex.printStackTrace();");
+ }
+ }
+ private void doProgress(Project project) {
+ ProgressManager.getInstance().run(new Task.Backgroundable(project, "Processing File", true) {
+ @Override
+ public void run(@NotNull ProgressIndicator indicator) {
+ indicator.setFraction(0.0);
+ for (int i = 0; i < 10; i++) {
+ indicator.setFraction((i + 1) / 10.0);
+ indicator.setText("Processing step " + (i + 1));
+ doSleep();
+ }
+ Messages.showInfoMessage("File processing complete!", "Main Action");
+ }
+ });
+ }
+
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ // NEEDO: insert action logic here
+ showProgress(e);
+ }
+
+ @Override
+ public void update(AnActionEvent e) {
+ // 获取当前选中的文件
+ VirtualFile file = e.getDataContext().getData(CommonDataKeys.VIRTUAL_FILE);
+ if (file != null && file.getExtension() != null) {
+ if (file.getExtension().equals("h")) {
+ // 如果是 .java 文件,显示 Action
+ e.getPresentation().setEnabledAndVisible(true);
+ } else {
+ // 否则隐藏 Action
+ e.getPresentation().setEnabledAndVisible(false);
+ }
+ } else {
+ // 否则隐藏 Action
+ e.getPresentation().setEnabledAndVisible(false);
+ }
+ }
+}
diff --git a/src/intellij_plugin/ohosgen/src/main/java/OhCrossCompile.java b/src/intellij_plugin/ohosgen/src/main/java/OhCrossCompile.java
new file mode 100644
index 0000000000000000000000000000000000000000..6ff9f41fd9b87bad9d24405e1a18a4af31d9db07
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/src/main/java/OhCrossCompile.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2025 Shenzhen Kaihong Digital.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.CommonDataKeys;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.vfs.VirtualFile;
+
+/**
+ *
类名:该类用于xxx
+ * description ${description}
+ *
+ * @author ${USER}
+ * date 2025-02-28
+ * @since 2025-02-28
+ * @version 1.0
+ */
+public class OhCrossCompile extends AnAction {
+
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ // NEEDO: insert action logic here
+ Messages.showInfoMessage("This is the OhCrossCompile!", "OhCrossCompile");
+ }
+
+ @Override
+ public void update(AnActionEvent e) {
+ // 获取当前选中的文件
+ VirtualFile file = e.getDataContext().getData(CommonDataKeys.VIRTUAL_FILE);
+ if (file != null && file.getExtension() != null) {
+ if (file.getExtension().equals("ts")) {
+ // 如果是 .java 文件,显示 Action
+ e.getPresentation().setEnabledAndVisible(true);
+ } else {
+ // 否则隐藏 Action
+ e.getPresentation().setEnabledAndVisible(false);
+ }
+ } else {
+ // 否则隐藏 Action
+ e.getPresentation().setEnabledAndVisible(false);
+ }
+ }
+}
diff --git a/src/intellij_plugin/ohosgen/src/main/java/OhosGenAction.java b/src/intellij_plugin/ohosgen/src/main/java/OhosGenAction.java
new file mode 100644
index 0000000000000000000000000000000000000000..96f8b63e3a5c4d27e719868d26a42ac333b1c79f
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/src/main/java/OhosGenAction.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2025 Shenzhen Kaihong Digital.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.actionSystem.CommonDataKeys;
+import com.intellij.openapi.ui.Messages;
+import com.intellij.openapi.vfs.VirtualFile;
+
+/**
+ *
类名:该类用于xxx
+ * description ${description}
+ *
+ * @author ${USER}
+ * date 2025-02-28
+ * @since 2025-02-28
+ * @version 1.0
+ */
+public class OhosGenAction extends AnAction {
+
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ // NEEDO: insert action logic here
+ Messages.showInfoMessage("This is the OhosGenAction!", "OhosGenAction");
+ }
+
+ @Override
+ public void update(AnActionEvent e) {
+ // 获取当前选中的文件
+ VirtualFile file = e.getDataContext().getData(CommonDataKeys.VIRTUAL_FILE);
+ if (file != null && file.getExtension() != null) {
+ if (file.getExtension().equals("ts") || file.getExtension().equals("h")) {
+ // 如果是 .java 文件,显示 Action
+ e.getPresentation().setEnabledAndVisible(true);
+ } else {
+ // 否则隐藏 Action
+ e.getPresentation().setEnabledAndVisible(false);
+ }
+ } else {
+ // 否则隐藏 Action
+ e.getPresentation().setEnabledAndVisible(false);
+ }
+ }
+}
diff --git a/src/intellij_plugin/ohosgen/src/main/java/PlugTestAction.java b/src/intellij_plugin/ohosgen/src/main/java/PlugTestAction.java
new file mode 100644
index 0000000000000000000000000000000000000000..a788de62f237f2a30c4839603f7ba154becc78c1
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/src/main/java/PlugTestAction.java
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2025 Shenzhen Kaihong Digital.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.ui.Messages;
+
+/**
+ *
类名:该类用于xxx
+ * description ${description}
+ *
+ * @author ${USER}
+ * date 2025-02-28
+ * @since 2025-02-28
+ * @version 1.0
+ */
+public class PlugTestAction extends AnAction {
+
+ @Override
+ public void actionPerformed(AnActionEvent e) {
+ // NEEDO: insert action logic here
+ System.out.println(" Plug Test Action!");
+ Project project = e.getProject();
+ if (project == null) {
+ Messages.showMessageDialog(
+ "No active project found",
+ "Error",
+ Messages.getErrorIcon()
+ );
+ return;
+ }
+
+ String result = "Proto Message: protoMessage.toString()";
+
+ Messages.showMessageDialog(
+ project,
+ result,
+ "Protobuf Demo",
+ Messages.getInformationIcon()
+ );
+ }
+}
diff --git a/src/intellij_plugin/ohosgen/src/main/java/gen/GenCppFile.java b/src/intellij_plugin/ohosgen/src/main/java/gen/GenCppFile.java
new file mode 100644
index 0000000000000000000000000000000000000000..2420afb2ba73a1174becdaf15a2ac550c488d57f
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/src/main/java/gen/GenCppFile.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2025 Shenzhen Kaihong Digital.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package gen;
+
+/**
+ *
类名:该类用于xxx
+ * description ${description}
+ *
+ * @author ${USER}
+ * date 2025-02-28
+ * @since 2025-02-28
+ * @version 1.0
+ */
+public class GenCppFile {
+}
diff --git a/src/intellij_plugin/ohosgen/src/main/java/gen/GenDtsFile.java b/src/intellij_plugin/ohosgen/src/main/java/gen/GenDtsFile.java
new file mode 100644
index 0000000000000000000000000000000000000000..1e9c5c9ac2eab1576da6c2ad32b51bf608b854a1
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/src/main/java/gen/GenDtsFile.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2025 Shenzhen Kaihong Digital.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package gen;
+
+/**
+ *
类名:该类用于xxx
+ * description ${description}
+ *
+ * @author ${USER}
+ * date 2025-02-28
+ * @since 2025-02-28
+ * @version 1.0
+ */
+public class GenDtsFile {
+}
diff --git a/src/intellij_plugin/ohosgen/src/main/java/gen/GenHeadFile.java b/src/intellij_plugin/ohosgen/src/main/java/gen/GenHeadFile.java
new file mode 100644
index 0000000000000000000000000000000000000000..97fb1c2ed814b2e196ce2d8929e5d076375d7cc7
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/src/main/java/gen/GenHeadFile.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2025 Shenzhen Kaihong Digital.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package gen;
+
+/**
+ *
类名:该类用于xxx
+ * description ${description}
+ *
+ * @author ${USER}
+ * date 2025-02-28
+ * @since 2025-02-28
+ * @version 1.0
+ */
+public class GenHeadFile {
+}
diff --git a/src/intellij_plugin/ohosgen/src/main/java/parse/ParseC.java b/src/intellij_plugin/ohosgen/src/main/java/parse/ParseC.java
new file mode 100644
index 0000000000000000000000000000000000000000..6646c7133b00019a406a0cddab52ed664b933b07
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/src/main/java/parse/ParseC.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2025 Shenzhen Kaihong Digital.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package parse;
+
+/**
+ *
类名:该类用于xxx
+ * description ${description}
+ *
+ * @author ${USER}
+ * date 2025-02-28
+ * @since 2025-02-28
+ * @version 1.0
+ */
+public class ParseC {
+}
diff --git a/src/intellij_plugin/ohosgen/src/main/java/parse/ParseTs.java b/src/intellij_plugin/ohosgen/src/main/java/parse/ParseTs.java
new file mode 100644
index 0000000000000000000000000000000000000000..343beaa0feec8822306c6e2a3cdfeff187b3cbdd
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/src/main/java/parse/ParseTs.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2025 Shenzhen Kaihong Digital.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package parse;
+
+/**
+ *
类名:该类用于xxx
+ * description ${description}
+ *
+ * @author ${USER}
+ * date 2025-02-28
+ * @since 2025-02-28
+ * @version 1.0
+ */
+public class ParseTs {
+}
diff --git a/src/intellij_plugin/ohosgen/src/main/java/utils/Constants.java b/src/intellij_plugin/ohosgen/src/main/java/utils/Constants.java
new file mode 100644
index 0000000000000000000000000000000000000000..ad3e577a700b4ebaba775082060d61838f106fd7
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/src/main/java/utils/Constants.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2025 Shenzhen Kaihong Digital.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package utils;
+
+/**
+ *
类名:该类用于xxx
+ * description ${description}
+ *
+ * @author ${USER}
+ * date 2025-02-28
+ * @since 2025-02-28
+ * @version 1.0
+ */
+public class Constants {
+}
diff --git a/src/intellij_plugin/ohosgen/src/main/java/utils/File.java b/src/intellij_plugin/ohosgen/src/main/java/utils/File.java
new file mode 100644
index 0000000000000000000000000000000000000000..84c141bace304abb79638e068ec9f35262f79304
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/src/main/java/utils/File.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2025 Shenzhen Kaihong Digital.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package utils;
+
+/**
+ *
类名:该类用于xxx
+ * description ${description}
+ *
+ * @author ${USER}
+ * date 2025-02-28
+ * @since 2025-02-28
+ * @version 1.0
+ */
+public class File {
+}
diff --git a/src/intellij_plugin/ohosgen/src/main/java/utils/Log.java b/src/intellij_plugin/ohosgen/src/main/java/utils/Log.java
new file mode 100644
index 0000000000000000000000000000000000000000..cca41d9bd255c1b5cdda51965ac244584b98f810
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/src/main/java/utils/Log.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2025 Shenzhen Kaihong Digital.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package utils;
+
+/**
+ *
类名:该类用于xxx
+ * description ${description}
+ *
+ * @author ${USER}
+ * date 2025-02-28
+ * @since 2025-02-28
+ * @version 1.0
+ */
+public class Log {
+}
diff --git a/src/intellij_plugin/ohosgen/src/main/java/utils/MockBgTask.java b/src/intellij_plugin/ohosgen/src/main/java/utils/MockBgTask.java
new file mode 100644
index 0000000000000000000000000000000000000000..c0902375f32f05f044c2bbed1d4a01ca6a7970c8
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/src/main/java/utils/MockBgTask.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2025-2025 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package utils;
+
+import com.intellij.openapi.progress.ProgressIndicator;
+import com.intellij.openapi.progress.Task;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.NlsContexts;
+import com.intellij.openapi.vfs.VirtualFile;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.io.IOException;
+
+/**
+ *
plugtest
+ *
+ * @author ${USER}
+ * date 2025-02-28
+ * @since 2025-02-28
+ * @version 1.0
+ */
+public class MockBgTask extends Task.Backgroundable {
+ private VirtualFile parseFile;
+
+ public MockBgTask(@Nullable Project project, @NlsContexts.ProgressTitle @NotNull String title, boolean flag) {
+ super(project, title, flag);
+ }
+
+ public void setFile(VirtualFile file) {
+ parseFile = file;
+ }
+
+ @Override
+ public void run(@NotNull ProgressIndicator indicator) {
+ doAnalysis(indicator);
+ }
+
+ private void doAnalysis(@NotNull ProgressIndicator indicator) {
+ indicator.setFraction(0.0);
+ // 新增文件读取逻辑
+ try {
+ String content = new String(parseFile.contentsToByteArray(), parseFile.getCharset());
+ System.out.println(content);
+
+ String[] lines = content.split("\n");
+ for (int i = 0; i < lines.length; i++) {
+ // 模拟处理每一行
+ indicator.setFraction((i + 1) / (double) lines.length);
+ indicator.setText("Dts2cpp steps : " + (i + 1) + "/" + lines.length);
+
+ // 这里添加实际业务逻辑
+ processLine(lines[i]);
+
+ Thread.sleep(50); // 调整延时更符合实际场景
+ }
+ } catch (InterruptedException | IOException ex) {
+ System.out.println("Error: " + ex.getMessage() + "Failure");
+ }
+ }
+
+ // 示例行处理方法
+ private void processLine(String line) {
+ // 实际业务逻辑(如语法分析/代码检查等)
+ }
+}
diff --git a/src/intellij_plugin/ohosgen/src/main/java/utils/PluginError.java b/src/intellij_plugin/ohosgen/src/main/java/utils/PluginError.java
new file mode 100644
index 0000000000000000000000000000000000000000..9a3c770609c2e0ff4fc986d232da72ed9fa288ff
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/src/main/java/utils/PluginError.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2025 Shenzhen Kaihong Digital.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package utils;
+
+/**
+ *
类名:该类用于xxx
+ * description ${description}
+ *
+ * @author ${USER}
+ * date 2025-02-28
+ * @since 2025-02-28
+ * @version 1.0
+ */
+public class PluginError {
+}
diff --git a/src/intellij_plugin/ohosgen/src/main/java/utils/Widget.java b/src/intellij_plugin/ohosgen/src/main/java/utils/Widget.java
new file mode 100644
index 0000000000000000000000000000000000000000..f4fec01e3f51c1f6075a1ea8d7f493d5161cd250
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/src/main/java/utils/Widget.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2025 Shenzhen Kaihong Digital.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package utils;
+
+/**
+ *
类名:该类用于xxx
+ * description ${description}
+ *
+ * @author ${USER}
+ * date 2025-02-28
+ * @since 2025-02-28
+ * @version 1.0
+ */
+public class Widget {
+}
diff --git a/src/intellij_plugin/ohosgen/src/main/resources/META-INF/plugin.xml b/src/intellij_plugin/ohosgen/src/main/resources/META-INF/plugin.xml
new file mode 100644
index 0000000000000000000000000000000000000000..32a236ac7af3b36b686562763690187023b071f7
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/src/main/resources/META-INF/plugin.xml
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ com.example.napigenerator
+
+
+ NapiGenerator
+
+
+ Kaihong Digital Industry Development Co.
+
+
+
+ transfer dts files to c files
+ ]]>
+
+
+ com.intellij.modules.platform
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/intellij_plugin/ohosgen/src/main/resources/META-INF/pluginIcon.svg b/src/intellij_plugin/ohosgen/src/main/resources/META-INF/pluginIcon.svg
new file mode 100644
index 0000000000000000000000000000000000000000..dcf6b99db0d595df511a51a8c6ef4a64f1eb30d4
--- /dev/null
+++ b/src/intellij_plugin/ohosgen/src/main/resources/META-INF/pluginIcon.svg
@@ -0,0 +1,12 @@
+
\ No newline at end of file