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/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 @@ + + + + + + + + true + true + false + + + \ No newline at end of file diff --git a/src/intellij_plugin/ohosgen/build.gradle.kts b/src/intellij_plugin/ohosgen/build.gradle.kts new file mode 100644 index 0000000000000000000000000000000000000000..0c35fd64fd4bccb066d024fe229bd32dd7289de7 --- /dev/null +++ b/src/intellij_plugin/ohosgen/build.gradle.kts @@ -0,0 +1,47 @@ +plugins { + id("java") + id("org.jetbrains.kotlin.jvm") version "1.9.25" + id("org.jetbrains.intellij") version "1.17.4" +} + +group = "com.example" +version = "1.0-SNAPSHOT" + +repositories { + mavenCentral() +} + +// Configure Gradle IntelliJ Plugin +// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html +intellij { + version.set("2024.1.7") + type.set("IC") // Target IDE Platform + + plugins.set(listOf(/* Plugin Dependencies */)) +} + +tasks { + // Set the JVM compatibility versions + withType { + sourceCompatibility = "17" + targetCompatibility = "17" + } + withType { + kotlinOptions.jvmTarget = "17" + } + + patchPluginXml { + sinceBuild.set("241") + untilBuild.set("243.*") + } + + signPlugin { + certificateChain.set(System.getenv("CERTIFICATE_CHAIN")) + privateKey.set(System.getenv("PRIVATE_KEY")) + password.set(System.getenv("PRIVATE_KEY_PASSWORD")) + } + + publishPlugin { + token.set(System.getenv("PUBLISH_TOKEN")) + } +} diff --git a/src/intellij_plugin/ohosgen/gradle.properties b/src/intellij_plugin/ohosgen/gradle.properties new file mode 100644 index 0000000000000000000000000000000000000000..24630b3f8bb9b56f0c33e5a157770fbdccbfbb92 --- /dev/null +++ b/src/intellij_plugin/ohosgen/gradle.properties @@ -0,0 +1,6 @@ +# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib +kotlin.stdlib.default.dependency=false +# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html +org.gradle.configuration-cache=true +# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html +org.gradle.caching=true diff --git a/src/intellij_plugin/ohosgen/gradle/wrapper/gradle-wrapper.jar b/src/intellij_plugin/ohosgen/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..249e5832f090a2944b7473328c07c9755baa3196 Binary files /dev/null and b/src/intellij_plugin/ohosgen/gradle/wrapper/gradle-wrapper.jar differ diff --git a/src/intellij_plugin/ohosgen/gradle/wrapper/gradle-wrapper.properties b/src/intellij_plugin/ohosgen/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000000000000000000000000000000000..81aa1c0448a219c604f9ecd164af437de0fed21a --- /dev/null +++ b/src/intellij_plugin/ohosgen/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/src/intellij_plugin/ohosgen/gradlew b/src/intellij_plugin/ohosgen/gradlew new file mode 100644 index 0000000000000000000000000000000000000000..1b6c787337ffb79f0e3cf8b1e9f00f680a959de1 --- /dev/null +++ b/src/intellij_plugin/ohosgen/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# 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 +# +# https://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. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/src/intellij_plugin/ohosgen/gradlew.bat b/src/intellij_plugin/ohosgen/gradlew.bat new file mode 100644 index 0000000000000000000000000000000000000000..107acd32c4e687021ef32db511e8a206129b88ec --- /dev/null +++ b/src/intellij_plugin/ohosgen/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/src/intellij_plugin/ohosgen/settings.gradle.kts b/src/intellij_plugin/ohosgen/settings.gradle.kts new file mode 100644 index 0000000000000000000000000000000000000000..0ab2117a4c81b896f2f68aaff5c4a97882648cd1 --- /dev/null +++ b/src/intellij_plugin/ohosgen/settings.gradle.kts @@ -0,0 +1,8 @@ +pluginManagement { + repositories { + mavenCentral() + gradlePluginPortal() + } +} + +rootProject.name = "plugtest" \ No newline at end of file diff --git a/src/intellij_plugin/ohosgen/src/main/java/Dts2cpp.java b/src/intellij_plugin/ohosgen/src/main/java/Dts2cpp.java new file mode 100644 index 0000000000000000000000000000000000000000..5a3d3c677212998d02fc5f53f6d0d8911505486f --- /dev/null +++ b/src/intellij_plugin/ohosgen/src/main/java/Dts2cpp.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development 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. + */ + +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.ui.Messages; +import com.intellij.openapi.vfs.VirtualFile; +import org.jetbrains.annotations.NotNull; + +import java.io.IOException; + +public class Dts2cpp extends AnAction { + + private void showProgress(AnActionEvent e) { +// 获取当前选中的文件 + VirtualFile file = e.getDataContext().getData(CommonDataKeys.VIRTUAL_FILE); + if (file != null && file.getExtension() != null && file.getExtension().equals("ts")) { + // 如果是 .java 文件,执行任务 + ProgressManager.getInstance().run(new Task.Backgroundable(e.getProject(), "Processing File", true) { + @Override + public void run(@NotNull ProgressIndicator indicator) { + indicator.setFraction(0.0); + // 新增文件读取逻辑 + try { + String content = new String(file.contentsToByteArray(), file.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"); + Messages.showErrorDialog("Error: " + ex.getMessage(), "Failure"); + } +// Messages.showInfoMessage("File processing complete!", "Main Action"); + } + + // 示例行处理方法 + private void processLine(String line) { + // 实际业务逻辑(如语法分析/代码检查等) + } + }); + } + } + + @Override + public void actionPerformed(AnActionEvent e) { + // TODO: insert action logic here +// Messages.showInfoMessage("This is the Dts2cpp!", "Dts2cpp"); + 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..3ea3b409fd5d0f516c50a84bd0dd7d5e7fd68d90 --- /dev/null +++ b/src/intellij_plugin/ohosgen/src/main/java/H2dtsAction.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development 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. + */ + +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.ui.Messages; +import com.intellij.openapi.vfs.VirtualFile; +import org.jetbrains.annotations.NotNull; + +public class H2dtsAction extends AnAction { + + private void showProgress(AnActionEvent e) { +// 获取当前选中的文件 + VirtualFile file = e.getDataContext().getData(CommonDataKeys.VIRTUAL_FILE); + if (file != null && file.getExtension() != null && file.getExtension().equals("h")) { + // 如果是 .java 文件,执行任务 + ProgressManager.getInstance().run(new Task.Backgroundable(e.getProject(), "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)); + try { + Thread.sleep(500); // 模拟耗时操作 + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + } + Messages.showInfoMessage("File processing complete!", "Main Action"); + } + }); + } + } + + @Override + public void actionPerformed(AnActionEvent e) { + // TODO: insert action logic here +// Messages.showInfoMessage("This is the Dts2cpp!", "Dts2cpp"); + 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..a163b21ac85f2421dc9d661453165078b50f2dd6 --- /dev/null +++ b/src/intellij_plugin/ohosgen/src/main/java/H2dtscppAction.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development 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. + */ + +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.ui.Messages; +import com.intellij.openapi.vfs.VirtualFile; +import org.jetbrains.annotations.NotNull; + +public class H2dtscppAction extends AnAction { + + private void showProgress(AnActionEvent e) { +// 获取当前选中的文件 + VirtualFile file = e.getDataContext().getData(CommonDataKeys.VIRTUAL_FILE); + if (file != null && file.getExtension() != null && file.getExtension().equals("h")) { + // 如果是 .java 文件,执行任务 + ProgressManager.getInstance().run(new Task.Backgroundable(e.getProject(), "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)); + try { + Thread.sleep(500); // 模拟耗时操作 + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + } + Messages.showInfoMessage("File processing complete!", "Main Action"); + } + }); + } + } + + @Override + public void actionPerformed(AnActionEvent e) { + // TODO: insert action logic here +// Messages.showInfoMessage("This is the Dts2cpp!", "Dts2cpp"); + 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..7a7c89d608f3c8582a1b9969598bbdb3f186637d --- /dev/null +++ b/src/intellij_plugin/ohosgen/src/main/java/H2hdf.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development 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. + */ + +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.ui.Messages; +import com.intellij.openapi.vfs.VirtualFile; +import org.jetbrains.annotations.NotNull; + +public class H2hdf extends AnAction { + + private void showProgress(AnActionEvent e) { +// 获取当前选中的文件 + VirtualFile file = e.getDataContext().getData(CommonDataKeys.VIRTUAL_FILE); + if (file != null && file.getExtension() != null && file.getExtension().equals("h")) { + // 如果是 .java 文件,执行任务 + ProgressManager.getInstance().run(new Task.Backgroundable(e.getProject(), "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)); + try { + Thread.sleep(500); // 模拟耗时操作 + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + } + Messages.showInfoMessage("File processing complete!", "Main Action"); + } + }); + } + } + + @Override + public void actionPerformed(AnActionEvent e) { + // TODO: insert action logic here +// Messages.showInfoMessage("This is the Dts2cpp!", "Dts2cpp"); + 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..f40bb9bcb3cd51b32d79e328c7580dbab7eb9fc4 --- /dev/null +++ b/src/intellij_plugin/ohosgen/src/main/java/H2sa.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development 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. + */ + +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.ui.Messages; +import com.intellij.openapi.vfs.VirtualFile; +import org.jetbrains.annotations.NotNull; + +public class H2sa extends AnAction { + + private void showProgress(AnActionEvent e) { +// 获取当前选中的文件 + VirtualFile file = e.getDataContext().getData(CommonDataKeys.VIRTUAL_FILE); + if (file != null && file.getExtension() != null && file.getExtension().equals("h")) { + // 如果是 .java 文件,执行任务 + ProgressManager.getInstance().run(new Task.Backgroundable(e.getProject(), "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)); + try { + Thread.sleep(500); // 模拟耗时操作 + } catch (InterruptedException ex) { + ex.printStackTrace(); + } + } + Messages.showInfoMessage("File processing complete!", "Main Action"); + } + }); + } + } + + @Override + public void actionPerformed(AnActionEvent e) { + // TODO: insert action logic here +// Messages.showInfoMessage("This is the Dts2cpp!", "Dts2cpp"); + 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..5de0f8abc6e1505810735fbf87c0866f4708030e --- /dev/null +++ b/src/intellij_plugin/ohosgen/src/main/java/OhCrossCompile.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development 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. + */ + +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; + +public class OhCrossCompile extends AnAction { + + @Override + public void actionPerformed(AnActionEvent e) { + // TODO: 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..1808b968078f221aa0f28e32202f69a3a4238e54 --- /dev/null +++ b/src/intellij_plugin/ohosgen/src/main/java/OhosGenAction.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development 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. + */ + +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; +public class OhosGenAction extends AnAction { + + @Override + public void actionPerformed(AnActionEvent e) { + // TODO: 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..702cecc6d6731d3784908ad6a38358eaae446cc9 --- /dev/null +++ b/src/intellij_plugin/ohosgen/src/main/java/PlugTestAction.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development 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. + */ + +import com.intellij.openapi.actionSystem.AnAction; +import com.intellij.openapi.actionSystem.AnActionEvent; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.ui.Messages; + +public class PlugTestAction extends AnAction { + + @Override + public void actionPerformed(AnActionEvent e) { + // TODO: 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; + } + +// Message protoMessage = buildProtobufMessage(); + String result = "Proto Message: protoMessage.toString()"; + + Messages.showMessageDialog( + project, + result, + "Protobuf Demo", + Messages.getInformationIcon() + ); + } + +// private Message buildProtobufMessage() { +// // 假设已通过protoc生成UserInfo类 +// return UserInfo.newBuilder() +// .setName("John") +// .setId(123) +// .build(); +// } +} 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..de3a1cc87af30fae56f7af76faa454c5d70b03f7 --- /dev/null +++ b/src/intellij_plugin/ohosgen/src/main/java/gen/GenCppFile.java @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development 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 gen; + +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..53641def5382aca48e4d2494b6112d76460be892 --- /dev/null +++ b/src/intellij_plugin/ohosgen/src/main/java/gen/GenDtsFile.java @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development 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 gen; + +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..dc261cbffa18e9a8c627f8c75acf72030f3032ba --- /dev/null +++ b/src/intellij_plugin/ohosgen/src/main/java/gen/GenHeadFile.java @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development 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 gen; + +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..82f4b36acf74499f6c606ed23915bd4432fac466 --- /dev/null +++ b/src/intellij_plugin/ohosgen/src/main/java/parse/ParseC.java @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development 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 parse; + +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..c3cc4dccf45afba439c44f2d2bf841429492f478 --- /dev/null +++ b/src/intellij_plugin/ohosgen/src/main/java/parse/ParseTs.java @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development 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 parse; + +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..bcb2d536385affd2bafc88a3ada031151fc230c3 --- /dev/null +++ b/src/intellij_plugin/ohosgen/src/main/java/utils/Constants.java @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development 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; + +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..6c261799b6f7249d9ab40c9f1334bac8bc7ac784 --- /dev/null +++ b/src/intellij_plugin/ohosgen/src/main/java/utils/File.java @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development 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; + +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..33c1d58b8fc6d2808e65d29fc53c6240af965fec --- /dev/null +++ b/src/intellij_plugin/ohosgen/src/main/java/utils/Log.java @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development 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; + +public class Log { +} 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..7b8b59eed26440bb3e2b1b733e08d3bb7f2ce750 --- /dev/null +++ b/src/intellij_plugin/ohosgen/src/main/java/utils/PluginError.java @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development 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; + +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..7633c9685c8ee04b3f7023521aa6abbc1bf2b80c --- /dev/null +++ b/src/intellij_plugin/ohosgen/src/main/java/utils/Widget.java @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2025 Shenzhen Kaihong Digital Industry Development 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; + +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..270e87fe3b761a3f1f7c1edeca2e4c09664fee46 --- /dev/null +++ b/src/intellij_plugin/ohosgen/src/main/resources/META-INF/plugin.xml @@ -0,0 +1,68 @@ + + + + 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