diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f3a0f54..da4c0bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,11 +38,11 @@ jobs: runs-on: ubuntu-latest steps: - # Setup Java 1.8 environment for the next steps + # Setup Java 1.17 environment for the next steps - name: Setup Java uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 1.17 # Check out current repository - name: Fetch Sources @@ -83,11 +83,11 @@ jobs: artifact: ${{ steps.properties.outputs.artifact }} steps: - # Setup Java 1.8 environment for the next steps + # Setup Java 1.17 environment for the next steps - name: Setup Java uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 1.17 # Check out current repository - name: Fetch Sources @@ -145,11 +145,11 @@ jobs: runs-on: ubuntu-latest steps: - # Setup Java 1.8 environment for the next steps + # Setup Java 1.17 environment for the next steps - name: Setup Java uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 1.17 # Check out current repository - name: Fetch Sources diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 382fa91..542fde7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,11 +14,11 @@ jobs: runs-on: ubuntu-latest steps: - # Setup Java 1.8 environment for the next steps + # Setup Java 1.17 environment for the next steps - name: Setup Java uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 1.17 # Check out current repository - name: Fetch Sources @@ -39,11 +39,11 @@ jobs: runs-on: ubuntu-latest steps: - # Setup Java 1.8 environment for the next steps + # Setup Java 1.17 environment for the next steps - name: Setup Java uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 1.17 # Check out current repository - name: Fetch Sources diff --git a/README.md b/README.md index 00859bf..ef8b99f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # regexPlugin -![Build](https://github.com/ggascoigne/regexPlugin/workflows/Build/badge.svg) +![Build](https://github.com/marsonge/regexPlugin/workflows/Build/badge.svg) [![Version](https://img.shields.io/jetbrains/plugin/v/PLUGIN_ID.svg)](https://plugins.jetbrains.com/plugin/PLUGIN_ID) [![Downloads](https://img.shields.io/jetbrains/plugin/d/PLUGIN_ID.svg)](https://plugins.jetbrains.com/plugin/PLUGIN_ID) @@ -14,11 +14,8 @@ - [ ] Click the Watch button on the top of the [IntelliJ Platform Plugin Template][template] to be notified about releases containing new features and fixes. -This Fancy IntelliJ Platform Plugin is going to be your implementation of the brilliant ideas that you have. - -This specific section is a source for the [plugin.xml](/src/main/resources/META-INF/plugin.xml) file which will be extracted by the [Gradle](/build.gradle.kts) during the build process. - -To keep everything working, do not remove `` sections. +A revival of the original Regex Plugin for IntelliJ. Now works with newer versions, and with some added QOL features. +Original version: https://plugins.jetbrains.com/plugin/19-regexplugin ## Installation diff --git a/build.gradle.kts b/build.gradle.kts index 31f0c6e..5fa2f65 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,122 +1,126 @@ -import io.gitlab.arturbosch.detekt.Detekt -import org.jetbrains.changelog.closure +import org.jetbrains.changelog.Changelog import org.jetbrains.changelog.markdownToHTML +fun properties(key: String) = providers.gradleProperty(key) +fun environment(key: String) = providers.environmentVariable(key) + plugins { - // Java support - id("java") - // gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin - id("org.jetbrains.intellij") version "0.6.5" - // gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin - id("org.jetbrains.changelog") version "0.6.2" - // detekt linter - read more: https://detekt.github.io/detekt/gradle.html - id("io.gitlab.arturbosch.detekt") version "1.15.0" - // ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle - id("org.jlleitschuh.gradle.ktlint") version "9.4.1" + id("java") // Java support + alias(libs.plugins.kotlin) // Kotlin support + alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin + alias(libs.plugins.changelog) // Gradle Changelog Plugin + alias(libs.plugins.qodana) // Gradle Qodana Plugin + alias(libs.plugins.kover) // Gradle Kover Plugin + id("org.openjfx.javafxplugin") version "0.0.13" //Webview for reference } -// Import variables from gradle.properties file -val pluginGroup: String by project -// `pluginName_` variable ends with `_` because of the collision with Kotlin magic getter in the `intellij` closure. -// Read more about the issue: https://github.com/JetBrains/intellij-platform-plugin-template/issues/29 -val pluginName_: String by project -val pluginVersion: String by project -val pluginSinceBuild: String by project -val pluginUntilBuild: String by project -val pluginVerifierIdeVersions: String by project - -val platformType: String by project -val platformVersion: String by project -val platformPlugins: String by project -val platformDownloadSources: String by project - -group = pluginGroup -version = pluginVersion +group = properties("pluginGroup").get() +version = properties("pluginVersion").get() // Configure project's dependencies repositories { mavenCentral() - jcenter() } dependencies { - detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.15.0") + implementation(kotlin("stdlib")) +} + + +// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+. +kotlin { + jvmToolchain(17) +} + +javafx { + modules("javafx.web", "javafx.swing") } -// Configure gradle-intellij-plugin plugin. -// Read more: https://github.com/JetBrains/gradle-intellij-plugin +// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html intellij { - pluginName = pluginName_ - version = platformVersion - type = platformType - downloadSources = platformDownloadSources.toBoolean() - updateSinceUntilBuild = true + pluginName = properties("pluginName") + version = properties("platformVersion") + type = properties("platformType") // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file. - setPlugins(*platformPlugins.split(',').map(String::trim).filter(String::isNotEmpty).toTypedArray()) + plugins = properties("platformPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) } } -// Configure detekt plugin. -// Read more: https://detekt.github.io/detekt/kotlindsl.html -detekt { - config = files("./detekt-config.yml") - buildUponDefaultConfig = true +// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin +changelog { + groups.empty() + repositoryUrl = properties("pluginRepositoryUrl") +} - reports { - html.enabled = false - xml.enabled = false - txt.enabled = false - } +// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin +qodana { + cachePath = provider { file(".qodana").canonicalPath } + reportPath = provider { file("build/reports/inspections").canonicalPath } + saveReport = true + showReport = environment("QODANA_SHOW_REPORT").map { it.toBoolean() }.getOrElse(false) } -tasks { - // Set the compatibility versions to 1.8 - withType { - sourceCompatibility = "1.8" - targetCompatibility = "1.8" - } +// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration +kover.xmlReport { + onCheck = true +} - withType { - jvmTarget = "1.8" +tasks { + wrapper { + gradleVersion = properties("gradleVersion").get() } patchPluginXml { - version(pluginVersion) - sinceBuild(pluginSinceBuild) - untilBuild(pluginUntilBuild) + version = properties("pluginVersion") + sinceBuild = properties("pluginSinceBuild") + untilBuild = properties("pluginUntilBuild") // Extract the section from README.md and provide for the plugin's manifest - pluginDescription( - closure { - File("./README.md").readText().lines().run { - val start = "" - val end = "" - - if (!containsAll(listOf(start, end))) { - throw GradleException("Plugin description section not found in README.md:\n$start ... $end") - } - subList(indexOf(start) + 1, indexOf(end)) - }.joinToString("\n").run { markdownToHTML(this) } + pluginDescription = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map { + val start = "" + val end = "" + + with (it.lines()) { + if (!containsAll(listOf(start, end))) { + throw GradleException("Plugin description section not found in README.md:\n$start ... $end") + } + subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML) } - ) + } + val changelog = project.changelog // local variable for configuration cache compatibility // Get the latest available change notes from the changelog file - changeNotes( - closure { - changelog.getLatest().toHTML() + changeNotes = properties("pluginVersion").map { pluginVersion -> + with(changelog) { + renderItem( + (getOrNull(pluginVersion) ?: getUnreleased()) + .withHeader(false) + .withEmptySections(false), + Changelog.OutputType.HTML, + ) } - ) + } + } + + // Configure UI tests plugin + // Read more: https://github.com/JetBrains/intellij-ui-test-robot + runIdeForUiTests { + systemProperty("robot-server.port", "8082") + systemProperty("ide.mac.message.dialogs.as.sheets", "false") + systemProperty("jb.privacy.policy.text", "") + systemProperty("jb.consents.confirmation.enabled", "false") } - runPluginVerifier { - ideVersions(pluginVerifierIdeVersions) + signPlugin { + certificateChainFile = file("certificate/chain.crt") + privateKeyFile = file("certificate/private.pem") } publishPlugin { dependsOn("patchChangelog") - token(System.getenv("PUBLISH_TOKEN")) - // pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3 + token = environment("PUBLISH_TOKEN") + // The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3 // Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more: - // https://jetbrains.org/intellij/sdk/docs/tutorials/build_system/deployment.html#specifying-a-release-channel - channels(pluginVersion.split('-').getOrElse(1) { "default" }.split('.').first()) + // https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel + channels = properties("pluginVersion").map { listOf(it.split('-').getOrElse(1) { "default" }.split('.').first()) } } } diff --git a/detekt-config.yml b/detekt-config.yml deleted file mode 100644 index f9b8d75..0000000 --- a/detekt-config.yml +++ /dev/null @@ -1,8 +0,0 @@ -# Default detekt configuration: -# https://github.com/detekt/detekt/blob/master/detekt-core/src/main/resources/default-detekt-config.yml - -formatting: - Indentation: - continuationIndentSize: 8 - ParameterListWrapping: - indentSize: 8 diff --git a/gradle.properties b/gradle.properties index 0527b39..38ab8c3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,22 +1,37 @@ -# IntelliJ Platform Artifacts Repositories -# -> https://www.jetbrains.org/intellij/sdk/docs/reference_guide/intellij_artifacts.html +# IntelliJ Platform Artifacts Repositories -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html -pluginGroup = com.github.ggascoigne.regexplugin -pluginName_ = regexPlugin +pluginGroup = com.timindustries.marsonge.regexpluginv2 +pluginName = RegexPluginV2 +pluginRepositoryUrl = https://github.com/Marsonge/regexPlugin +# SemVer format -> https://semver.org pluginVersion = 0.0.1 -pluginSinceBuild = 201 -pluginUntilBuild = 203.* -# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl -# See https://jb.gg/intellij-platform-builds-list for available build versions -pluginVerifierIdeVersions = 2020.1.4, 2020.2.3, 2020.3 +# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html +pluginSinceBuild = 221 +pluginUntilBuild = 231.* + +# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension platformType = IC -platformVersion = 2020.1 -platformDownloadSources = true -# Plugin Dependencies -> https://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_dependencies.html +platformVersion = 2023.1 + +# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html # Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22 platformPlugins = -# Opt-out flag for bundling Kotlin standard library. -# See https://kotlinlang.org/docs/reference/using-gradle.html#dependency-on-the-standard-library for details. +# Gradle Releases -> https://github.com/gradle/gradle/releases +gradleVersion = 8.1 + +# 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 + +# Enable Gradle Kotlin DSL Lazy Property Assignment -> https://docs.gradle.org/current/userguide/kotlin_dsl.html#kotdsl:assignment +systemProp.org.gradle.unsafe.kotlin.assignment = true + +# Temporary workaround for Kotlin Compiler OutOfMemoryError -> https://jb.gg/intellij-platform-kotlin-oom +kotlin.incremental.useClasspathSnapshot = false diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..a76626a --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,22 @@ +[versions] +# libraries +annotations = "24.0.1" + +# plugins +dokka = "1.8.10" +kotlin = "1.8.10" +changelog = "2.0.0" +gradleIntelliJPlugin = "1.13.3" +qodana = "0.1.13" +kover = "0.6.1" + +[libraries] +annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" } + +[plugins] +changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" } +dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } +gradleIntelliJPlugin = { id = "org.jetbrains.intellij", version.ref = "gradleIntelliJPlugin" } +kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" } +qodana = { id = "org.jetbrains.qodana", version.ref = "qodana" } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1f3fdbc..0ad737d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index 87bd740..df7ce45 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1 +1 @@ -rootProject.name = "regexPlugin" +rootProject.name = "regexPluginV2" diff --git a/src/main/java/com/wyrdrune/regexplugin/AutoUpdateDocumentListener.java b/src/main/java/com/timindustries/regexpluginv2/AutoUpdateDocumentListener.java old mode 100755 new mode 100644 similarity index 87% rename from src/main/java/com/wyrdrune/regexplugin/AutoUpdateDocumentListener.java rename to src/main/java/com/timindustries/regexpluginv2/AutoUpdateDocumentListener.java index 64702d5..137065e --- a/src/main/java/com/wyrdrune/regexplugin/AutoUpdateDocumentListener.java +++ b/src/main/java/com/timindustries/regexpluginv2/AutoUpdateDocumentListener.java @@ -1,9 +1,9 @@ -package com.wyrdrune.regexplugin; +package com.timindustries.regexpluginv2; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; -import com.wyrdrune.regexplugin.actions.GenericAction; +import com.timindustries.regexpluginv2.actions.GenericAction; class AutoUpdateDocumentListener implements DocumentListener { diff --git a/src/main/java/com/wyrdrune/regexplugin/ExampleFileFilter.java b/src/main/java/com/timindustries/regexpluginv2/ExampleFileFilter.java old mode 100755 new mode 100644 similarity index 99% rename from src/main/java/com/wyrdrune/regexplugin/ExampleFileFilter.java rename to src/main/java/com/timindustries/regexpluginv2/ExampleFileFilter.java index a1fb020..a92cd7b --- a/src/main/java/com/wyrdrune/regexplugin/ExampleFileFilter.java +++ b/src/main/java/com/timindustries/regexpluginv2/ExampleFileFilter.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin; +package com.timindustries.regexpluginv2; /* * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved. diff --git a/src/main/java/com/wyrdrune/regexplugin/Group.java b/src/main/java/com/timindustries/regexpluginv2/Group.java old mode 100755 new mode 100644 similarity index 90% rename from src/main/java/com/wyrdrune/regexplugin/Group.java rename to src/main/java/com/timindustries/regexpluginv2/Group.java index b699a3f..f583ddd --- a/src/main/java/com/wyrdrune/regexplugin/Group.java +++ b/src/main/java/com/timindustries/regexpluginv2/Group.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin; +package com.timindustries.regexpluginv2; import java.util.regex.Matcher; diff --git a/src/main/java/com/wyrdrune/regexplugin/IconCache.java b/src/main/java/com/timindustries/regexpluginv2/IconCache.java old mode 100755 new mode 100644 similarity index 94% rename from src/main/java/com/wyrdrune/regexplugin/IconCache.java rename to src/main/java/com/timindustries/regexpluginv2/IconCache.java index 17f36b7..12e0282 --- a/src/main/java/com/wyrdrune/regexplugin/IconCache.java +++ b/src/main/java/com/timindustries/regexpluginv2/IconCache.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin; +package com.timindustries.regexpluginv2; import java.net.URL; import java.util.HashMap; diff --git a/src/main/java/com/wyrdrune/regexplugin/LibraryManager.java b/src/main/java/com/timindustries/regexpluginv2/LibraryManager.java old mode 100755 new mode 100644 similarity index 93% rename from src/main/java/com/wyrdrune/regexplugin/LibraryManager.java rename to src/main/java/com/timindustries/regexpluginv2/LibraryManager.java index 578f2a2..ae39fd1 --- a/src/main/java/com/wyrdrune/regexplugin/LibraryManager.java +++ b/src/main/java/com/timindustries/regexpluginv2/LibraryManager.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin; +package com.timindustries.regexpluginv2; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -14,12 +14,12 @@ import javax.swing.event.PopupMenuEvent; import javax.swing.event.PopupMenuListener; -import com.wyrdrune.regexplugin.event.EventManager; -import com.wyrdrune.regexplugin.event.Notifiable; -import com.wyrdrune.regexplugin.library.LibraryComboBoxModel; +import com.timindustries.regexpluginv2.library.LibraryComboBoxModel; +import com.timindustries.regexpluginv2.event.EventManager; +import com.timindustries.regexpluginv2.event.Notifiable; public class LibraryManager implements ActionListener, PopupMenuListener, Notifiable { - static final String libraryRoot = "regexPlugin/Library"; + static final String libraryRoot = "regexPluginV2/Library"; public static final String EVENT_NEW = "new"; @@ -31,7 +31,7 @@ public class LibraryManager implements ActionListener, PopupMenuListener, Notifi public static final String EVENT_IMPORT = "import"; - private com.wyrdrune.regexplugin.RegexPanel m_panel; + private RegexPanel m_panel; private String m_currentLibraryName; @@ -46,7 +46,7 @@ public class LibraryManager implements ActionListener, PopupMenuListener, Notifi public LibraryManager() { } - public void init(final com.wyrdrune.regexplugin.RegexPanel panel) { + public void init(final RegexPanel panel) { m_panel = panel; } @@ -266,7 +266,7 @@ public static void delete(final String libraryName) { .fireEvent(EventManager.getGlobalTarget(), LibraryManager.EVENT_DELETE, libraryName); } catch (BackingStoreException e) { - com.wyrdrune.regexplugin.Utils.handleException("error.libraryDelete", e); + Utils.handleException("error.libraryDelete", e); } } @@ -335,7 +335,7 @@ public void imported() { try { prefs.flush(); } catch (BackingStoreException e) { - com.wyrdrune.regexplugin.Utils.handleException("error.importingLibrary", e); + Utils.handleException("error.importingLibrary", e); } loadModel(m_panel.getLibraryModel()); } @@ -350,7 +350,7 @@ public static void importFile(final String fileName) { .fireEvent(EventManager.getGlobalTarget(), LibraryManager.EVENT_IMPORT, null); } catch (Exception e) { - com.wyrdrune.regexplugin.Utils.handleException("error.importingLibrary", e); + Utils.handleException("error.importingLibrary", e); } } @@ -362,7 +362,7 @@ public static void exportFile(final String fileName) { prefs.exportSubtree(os); os.close(); } catch (Exception e) { - com.wyrdrune.regexplugin.Utils.handleException("error.exportingLibrary", e); + Utils.handleException("error.exportingLibrary", e); } } diff --git a/src/main/java/com/wyrdrune/regexplugin/Match.java b/src/main/java/com/timindustries/regexpluginv2/Match.java old mode 100755 new mode 100644 similarity index 94% rename from src/main/java/com/wyrdrune/regexplugin/Match.java rename to src/main/java/com/timindustries/regexpluginv2/Match.java index f70ade3..971c230 --- a/src/main/java/com/wyrdrune/regexplugin/Match.java +++ b/src/main/java/com/timindustries/regexpluginv2/Match.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin; +package com.timindustries.regexpluginv2; import java.util.ArrayList; import java.util.regex.Matcher; diff --git a/src/main/java/com/wyrdrune/regexplugin/MatchAction.java b/src/main/java/com/timindustries/regexpluginv2/MatchAction.java old mode 100755 new mode 100644 similarity index 68% rename from src/main/java/com/wyrdrune/regexplugin/MatchAction.java rename to src/main/java/com/timindustries/regexpluginv2/MatchAction.java index 6dfef9a..75c579b --- a/src/main/java/com/wyrdrune/regexplugin/MatchAction.java +++ b/src/main/java/com/timindustries/regexpluginv2/MatchAction.java @@ -1,13 +1,11 @@ -package com.wyrdrune.regexplugin; +package com.timindustries.regexpluginv2; import java.awt.*; import java.util.ArrayList; -import java.util.Iterator; import java.util.regex.Matcher; import java.util.regex.Pattern; -import com.wyrdrune.regexplugin.actions.GenericAction; -import com.wyrdrune.regexplugin.uiInterface.ComponentManager; +import com.timindustries.regexpluginv2.actions.GenericAction; public class MatchAction extends GenericAction { @@ -21,7 +19,7 @@ public class MatchAction extends GenericAction { private Pattern pattern = null; - public MatchAction(final RegexPanel regexPanel, final com.wyrdrune.regexplugin.IconCache icons) { + public MatchAction(final RegexPanel regexPanel, final IconCache icons) { super(regexPanel, "find", icons.getIcon("find.png")); this.regexPanel = regexPanel; this.foundMatches = new ArrayList(); @@ -140,26 +138,36 @@ private void makeHtmlOutput(final String text, final Matcher matcher) { } } - final StringBuilder out = new StringBuilder(""); + final StringBuilder out = new StringBuilder(""); int idx = 0; - final Iterator i = foundMatches.iterator(); - int matchIdx = 0; - while (i.hasNext()) { - final Match match = i.next(); + for (int i = 0; i < foundMatches.size(); i++) { + final Match match = foundMatches.get(i); final String beforeMatch = text.substring(idx, match.getStartIdx()); out.append(convertToHTML(beforeMatch)); - String color = colorToHex(ComponentManager.getInstance().getMatchColor1()); - if ((matchIdx % 2) != 0) { - color = colorToHex(ComponentManager.getInstance().getMatchColor2()); + + String totalLine = match.groups.get(0).text; + + var decal = -1*(text.substring(0, match.getStartIdx()).length()); + for(int j = 1; j < match.groups.size(); j++){ + String fragment = "".concat("") + .concat(convertToHTML(nvl(match.groups.get(j).text))) + .concat(""); + totalLine = totalLine.substring(0, calculateStartFragmentIndexOffset(match, j, decal)) + .concat(fragment) + .concat(totalLine.substring(calculateEndFragmentIndexOffset(match, decal, j))); + decal += fragment.length() - match.groups.get(j).text.length(); } + out.append("") - .append(convertToHTML(match.getText())) - .append(""); + .append(i) + .append("\">") + .append(totalLine) + .append(""); + idx = match.getEndIdx(); } if (idx < text.length()) { @@ -170,8 +178,24 @@ private void makeHtmlOutput(final String text, final Matcher matcher) { regexPanel.getFindOutputComponent().setText(out.toString()); } + private static String nvl(String s) { + return s == null ? "" : s; + } + + private static int calculateEndFragmentIndexOffset(Match match, int decal, int j) { + return match.groups.get(j).endIdx + decal; + } + + private static int calculateStartFragmentIndexOffset(Match match, int j, int decal) { + return match.groups.get(j).startIdx + decal; + } + private String colorToHex(Color color) { - return String.format("#%02x%02x%02x", color.getRed(), color.getGreen(), color.getBlue()); + return String.format("#%02x%02x%02x30", color.getRed(), color.getGreen(), color.getBlue()); + } + + private String randomRgba(){ + return String.format("rgba(%d, %d, %d, 0.6)", (int)(Math.random()*1000)%255, (int)(Math.random()*1000)%100,(int)(Math.random()*1000)%255); } public void setReplaceAll(final boolean b) { diff --git a/src/main/java/com/wyrdrune/regexplugin/RegexPanel.java b/src/main/java/com/timindustries/regexpluginv2/RegexPanel.java old mode 100755 new mode 100644 similarity index 89% rename from src/main/java/com/wyrdrune/regexplugin/RegexPanel.java rename to src/main/java/com/timindustries/regexpluginv2/RegexPanel.java index 4ad5afc..3ae12b0 --- a/src/main/java/com/wyrdrune/regexplugin/RegexPanel.java +++ b/src/main/java/com/timindustries/regexpluginv2/RegexPanel.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin; +package com.timindustries.regexpluginv2; import java.awt.*; import java.awt.event.ActionEvent; @@ -16,21 +16,21 @@ import javax.swing.undo.UndoManager; import com.intellij.openapi.actionSystem.DefaultActionGroup; -import com.wyrdrune.regexplugin.actions.DeleteCurrentLibraryEntryAction; -import com.wyrdrune.regexplugin.actions.GenericAction; -import com.wyrdrune.regexplugin.actions.GenericToggleAction; -import com.wyrdrune.regexplugin.actions.NewLibraryEntryAction; -import com.wyrdrune.regexplugin.actions.ReplaceAllAction; -import com.wyrdrune.regexplugin.actions.ToggleAutoUpdateAction; -import com.wyrdrune.regexplugin.actions.ToggleFlagAction; -import com.wyrdrune.regexplugin.event.EventManager; -import com.wyrdrune.regexplugin.event.ObjectEvent; -import com.wyrdrune.regexplugin.event.ObjectListener; -import com.wyrdrune.regexplugin.library.LibraryComboBoxModel; -import com.wyrdrune.regexplugin.regexEditor.RegexEditor; -import com.wyrdrune.regexplugin.ui.LabelEx; -import com.wyrdrune.regexplugin.ui.Resources; -import com.wyrdrune.regexplugin.uiInterface.ComponentManager; +import com.timindustries.regexpluginv2.library.LibraryComboBoxModel; +import com.timindustries.regexpluginv2.regexEditor.RegexEditor; +import com.timindustries.regexpluginv2.ui.LabelEx; +import com.timindustries.regexpluginv2.uiInterface.ComponentManager; +import com.timindustries.regexpluginv2.actions.DeleteCurrentLibraryEntryAction; +import com.timindustries.regexpluginv2.actions.GenericAction; +import com.timindustries.regexpluginv2.actions.GenericToggleAction; +import com.timindustries.regexpluginv2.actions.NewLibraryEntryAction; +import com.timindustries.regexpluginv2.actions.ReplaceAllAction; +import com.timindustries.regexpluginv2.actions.ToggleAutoUpdateAction; +import com.timindustries.regexpluginv2.actions.ToggleFlagAction; +import com.timindustries.regexpluginv2.event.EventManager; +import com.timindustries.regexpluginv2.event.ObjectEvent; +import com.timindustries.regexpluginv2.event.ObjectListener; +import com.timindustries.regexpluginv2.ui.Resources; public class RegexPanel extends JPanel { @@ -70,9 +70,9 @@ public class RegexPanel extends JPanel { private final RegexPluginConfig config; - private final com.wyrdrune.regexplugin.IconCache iconCache = new com.wyrdrune.regexplugin.IconCache(); + private final IconCache iconCache = new IconCache(); - private final com.wyrdrune.regexplugin.ToggleSplitPane fTogglePane; + private final ToggleSplitPane fTogglePane; private final JComponent fToolbar; @@ -88,9 +88,9 @@ public RegexPanel(final RegexPluginConfig config, setLayout(new BorderLayout()); fMatchAction = new MatchAction(this, iconCache); - final com.wyrdrune.regexplugin.AutoUpdateDocumentListener + final AutoUpdateDocumentListener autoUpdater = - new com.wyrdrune.regexplugin.AutoUpdateDocumentListener( + new AutoUpdateDocumentListener( fMatchAction, config); final JScrollPane patternScrollPane = createPatternScrollPane(autoUpdater); @@ -113,7 +113,7 @@ public RegexPanel(final RegexPluginConfig config, leftPane = createSplitPane(JSplitPane.VERTICAL_SPLIT, upperPane, lowerPane); midPane = createSplitPane(JSplitPane.HORIZONTAL_SPLIT, leftPane, replacePane); - fTogglePane = new com.wyrdrune.regexplugin.ToggleSplitPane(midPane, createReferenceScrollPane(), + fTogglePane = new ToggleSplitPane(midPane, createReferenceScrollPane(), iconCache); config.initializeSize(getSize(), false); @@ -201,8 +201,9 @@ private JScrollPane createMatchDetailsScrollPane() { private JScrollPane createFindOutputScrollPane() { findOutput = createHtmlOutputPane(); - final JScrollPane scrolledFindOutput = uiFactory.getScrollPane(findOutput); findOutput.setBackground(uiFactory.getDefaultBackgroundColor()); + final JScrollPane scrolledFindOutput = uiFactory.getScrollPane(findOutput); + scrolledFindOutput.setBorder( BorderFactory.createTitledBorder(Resources.getTitle("findOutput"))); @@ -222,7 +223,7 @@ private JScrollPane createReplaceOutputScrollPane() { } private JScrollPane createReplaceInputScrollPane( - final com.wyrdrune.regexplugin.AutoUpdateDocumentListener autoUpdater) { + final AutoUpdateDocumentListener autoUpdater) { replaceInput = new JTextArea(5, 5); installUndoStuff(replaceInput); @@ -237,7 +238,7 @@ private JScrollPane createReplaceInputScrollPane( } private JScrollPane createTextScrollPane( - final com.wyrdrune.regexplugin.AutoUpdateDocumentListener autoUpdater) { + final AutoUpdateDocumentListener autoUpdater) { text = new JTextArea(5, 5); installUndoStuff(text); @@ -252,7 +253,7 @@ private JScrollPane createTextScrollPane( } private JScrollPane createPatternScrollPane( - final com.wyrdrune.regexplugin.AutoUpdateDocumentListener autoUpdater) { + final AutoUpdateDocumentListener autoUpdater) { pattern = new RegexEditor(fMatchAction); installUndoStuff(pattern); @@ -386,6 +387,8 @@ private JSplitPane createSplitPane(final int dir, final JComponent first, private JTextPane createHtmlOutputPane() { final JTextPane res = new JTextPane(); + var font = uiFactory.getDefaultFont().deriveFont(48f); + res.setFont(font); res.setEditable(false); res.setContentType("text/html"); res.addHyperlinkListener(new HyperlinkListener() { @@ -401,8 +404,18 @@ public void hyperlinkUpdate(final HyperlinkEvent hyperlinkEvent) { return res; } + private JTextPane createHtmlPaneForReference() { + final JTextPane res = new JTextPane(); + var font = uiFactory.getDefaultFont(); + res.setFont(font); + res.setEditable(false); + res.setContentType("text/html"); + return res; + } + + private JTextComponent createReferencePane() { - final JEditorPane reference = new JEditorPane(); + var reference = createHtmlPaneForReference(); reference.setEditable(false); try { final URL url = getClass().getResource("/help/reference.html"); @@ -419,7 +432,7 @@ private void showMatchDetails(final Match match) { final Iterator i = match.getGroups().iterator(); int idx = 0; while (i.hasNext()) { - final com.wyrdrune.regexplugin.Group group = (com.wyrdrune.regexplugin.Group) i.next(); + final Group group = (Group) i.next(); res.append("Group[").append(idx++).append("] \""); res.append(group.getText()).append("\" at "); res.append(group.getStartIdx()).append(" - "); @@ -466,7 +479,7 @@ public String getCurrentLibraryName() { return libraryManager.getCurrentLibraryName(); } - public com.wyrdrune.regexplugin.IconCache getIconCache() { + public IconCache getIconCache() { return iconCache; } diff --git a/src/main/java/com/wyrdrune/regexplugin/RegexPluginConfig.java b/src/main/java/com/timindustries/regexpluginv2/RegexPluginConfig.java old mode 100755 new mode 100644 similarity index 99% rename from src/main/java/com/wyrdrune/regexplugin/RegexPluginConfig.java rename to src/main/java/com/timindustries/regexpluginv2/RegexPluginConfig.java index 70b9c94..04000d3 --- a/src/main/java/com/wyrdrune/regexplugin/RegexPluginConfig.java +++ b/src/main/java/com/timindustries/regexpluginv2/RegexPluginConfig.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin; +package com.timindustries.regexpluginv2; import java.awt.*; import java.util.Iterator; diff --git a/src/main/java/com/wyrdrune/regexplugin/RegexPluginToolWindow.java b/src/main/java/com/timindustries/regexpluginv2/RegexPluginToolWindow.java old mode 100755 new mode 100644 similarity index 78% rename from src/main/java/com/wyrdrune/regexplugin/RegexPluginToolWindow.java rename to src/main/java/com/timindustries/regexpluginv2/RegexPluginToolWindow.java index 9ebca0b..d02e4de --- a/src/main/java/com/wyrdrune/regexplugin/RegexPluginToolWindow.java +++ b/src/main/java/com/timindustries/regexpluginv2/RegexPluginToolWindow.java @@ -1,9 +1,9 @@ -package com.wyrdrune.regexplugin; +package com.timindustries.regexpluginv2; import javax.swing.*; import com.intellij.openapi.wm.ToolWindow; -import com.wyrdrune.regexplugin.uiInterface.ComponentFactory; +import com.timindustries.regexpluginv2.uiInterface.ComponentFactory; public class RegexPluginToolWindow { diff --git a/src/main/java/com/wyrdrune/regexplugin/RegexPluginToolWindowFactory.java b/src/main/java/com/timindustries/regexpluginv2/RegexPluginToolWindowFactory.java similarity index 96% rename from src/main/java/com/wyrdrune/regexplugin/RegexPluginToolWindowFactory.java rename to src/main/java/com/timindustries/regexpluginv2/RegexPluginToolWindowFactory.java index 4322c0a..7aa84ac 100644 --- a/src/main/java/com/wyrdrune/regexplugin/RegexPluginToolWindowFactory.java +++ b/src/main/java/com/timindustries/regexpluginv2/RegexPluginToolWindowFactory.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin; +package com.timindustries.regexpluginv2; import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.Project; diff --git a/src/main/java/com/wyrdrune/regexplugin/ToggleSplitPane.java b/src/main/java/com/timindustries/regexpluginv2/ToggleSplitPane.java old mode 100755 new mode 100644 similarity index 94% rename from src/main/java/com/wyrdrune/regexplugin/ToggleSplitPane.java rename to src/main/java/com/timindustries/regexpluginv2/ToggleSplitPane.java index 413dd21..053d997 --- a/src/main/java/com/wyrdrune/regexplugin/ToggleSplitPane.java +++ b/src/main/java/com/timindustries/regexpluginv2/ToggleSplitPane.java @@ -1,10 +1,10 @@ -package com.wyrdrune.regexplugin; +package com.timindustries.regexpluginv2; import java.awt.*; import javax.swing.*; -import com.wyrdrune.regexplugin.actions.GenericToggleAction; +import com.timindustries.regexpluginv2.actions.GenericToggleAction; public class ToggleSplitPane extends JPanel { private final JComponent fFirst; diff --git a/src/main/java/com/wyrdrune/regexplugin/Utils.java b/src/main/java/com/timindustries/regexpluginv2/Utils.java old mode 100755 new mode 100644 similarity index 90% rename from src/main/java/com/wyrdrune/regexplugin/Utils.java rename to src/main/java/com/timindustries/regexpluginv2/Utils.java index fd79f19..3674434 --- a/src/main/java/com/wyrdrune/regexplugin/Utils.java +++ b/src/main/java/com/timindustries/regexpluginv2/Utils.java @@ -1,11 +1,11 @@ -package com.wyrdrune.regexplugin; +package com.timindustries.regexpluginv2; import java.io.PrintWriter; import java.io.StringWriter; import javax.swing.*; -import com.wyrdrune.regexplugin.ui.Resources; +import com.timindustries.regexpluginv2.ui.Resources; public class Utils { diff --git a/src/main/java/com/wyrdrune/regexplugin/actions/CopyQuotedJavaRegexStringAction.java b/src/main/java/com/timindustries/regexpluginv2/actions/CopyQuotedJavaRegexStringAction.java old mode 100755 new mode 100644 similarity index 84% rename from src/main/java/com/wyrdrune/regexplugin/actions/CopyQuotedJavaRegexStringAction.java rename to src/main/java/com/timindustries/regexpluginv2/actions/CopyQuotedJavaRegexStringAction.java index 0ff1f32..74a04c0 --- a/src/main/java/com/wyrdrune/regexplugin/actions/CopyQuotedJavaRegexStringAction.java +++ b/src/main/java/com/timindustries/regexpluginv2/actions/CopyQuotedJavaRegexStringAction.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.actions; +package com.timindustries.regexpluginv2.actions; import java.awt.*; import java.awt.datatransfer.Clipboard; @@ -6,8 +6,8 @@ import javax.swing.text.JTextComponent; -import com.wyrdrune.regexplugin.MatchAction; -import com.wyrdrune.regexplugin.RegexPanel; +import com.timindustries.regexpluginv2.MatchAction; +import com.timindustries.regexpluginv2.RegexPanel; public class CopyQuotedJavaRegexStringAction extends GenericAction { private final MatchAction m_anAction; diff --git a/src/main/java/com/wyrdrune/regexplugin/actions/CopyRegexStringAction.java b/src/main/java/com/timindustries/regexpluginv2/actions/CopyRegexStringAction.java old mode 100755 new mode 100644 similarity index 86% rename from src/main/java/com/wyrdrune/regexplugin/actions/CopyRegexStringAction.java rename to src/main/java/com/timindustries/regexpluginv2/actions/CopyRegexStringAction.java index 88f6ddd..398d9e3 --- a/src/main/java/com/wyrdrune/regexplugin/actions/CopyRegexStringAction.java +++ b/src/main/java/com/timindustries/regexpluginv2/actions/CopyRegexStringAction.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.actions; +package com.timindustries.regexpluginv2.actions; import java.awt.*; import java.awt.datatransfer.Clipboard; @@ -6,7 +6,7 @@ import javax.swing.text.JTextComponent; -import com.wyrdrune.regexplugin.RegexPanel; +import com.timindustries.regexpluginv2.RegexPanel; public class CopyRegexStringAction extends GenericAction { diff --git a/src/main/java/com/wyrdrune/regexplugin/actions/DeleteCurrentLibraryEntryAction.java b/src/main/java/com/timindustries/regexpluginv2/actions/DeleteCurrentLibraryEntryAction.java old mode 100755 new mode 100644 similarity index 68% rename from src/main/java/com/wyrdrune/regexplugin/actions/DeleteCurrentLibraryEntryAction.java rename to src/main/java/com/timindustries/regexpluginv2/actions/DeleteCurrentLibraryEntryAction.java index 6d24023..cc9947b --- a/src/main/java/com/wyrdrune/regexplugin/actions/DeleteCurrentLibraryEntryAction.java +++ b/src/main/java/com/timindustries/regexpluginv2/actions/DeleteCurrentLibraryEntryAction.java @@ -1,7 +1,7 @@ -package com.wyrdrune.regexplugin.actions; +package com.timindustries.regexpluginv2.actions; -import com.wyrdrune.regexplugin.LibraryManager; -import com.wyrdrune.regexplugin.RegexPanel; +import com.timindustries.regexpluginv2.LibraryManager; +import com.timindustries.regexpluginv2.RegexPanel; public class DeleteCurrentLibraryEntryAction extends GenericAction { public DeleteCurrentLibraryEntryAction(final RegexPanel panel) { diff --git a/src/main/java/com/wyrdrune/regexplugin/actions/ExportLibraryAction.java b/src/main/java/com/timindustries/regexpluginv2/actions/ExportLibraryAction.java old mode 100755 new mode 100644 similarity index 72% rename from src/main/java/com/wyrdrune/regexplugin/actions/ExportLibraryAction.java rename to src/main/java/com/timindustries/regexpluginv2/actions/ExportLibraryAction.java index 43f604a..61e3878 --- a/src/main/java/com/wyrdrune/regexplugin/actions/ExportLibraryAction.java +++ b/src/main/java/com/timindustries/regexpluginv2/actions/ExportLibraryAction.java @@ -1,6 +1,6 @@ -package com.wyrdrune.regexplugin.actions; +package com.timindustries.regexpluginv2.actions; -import com.wyrdrune.regexplugin.RegexPanel; +import com.timindustries.regexpluginv2.RegexPanel; public class ExportLibraryAction extends GenericAction { public ExportLibraryAction(final RegexPanel panel) { diff --git a/src/main/java/com/wyrdrune/regexplugin/actions/GenericAction.java b/src/main/java/com/timindustries/regexpluginv2/actions/GenericAction.java old mode 100755 new mode 100644 similarity index 77% rename from src/main/java/com/wyrdrune/regexplugin/actions/GenericAction.java rename to src/main/java/com/timindustries/regexpluginv2/actions/GenericAction.java index 8759aae..27dee0b --- a/src/main/java/com/wyrdrune/regexplugin/actions/GenericAction.java +++ b/src/main/java/com/timindustries/regexpluginv2/actions/GenericAction.java @@ -1,9 +1,9 @@ -package com.wyrdrune.regexplugin.actions; +package com.timindustries.regexpluginv2.actions; import javax.swing.*; -import com.wyrdrune.regexplugin.RegexPanel; -import com.wyrdrune.regexplugin.ui.Resources; +import com.timindustries.regexpluginv2.RegexPanel; +import com.timindustries.regexpluginv2.ui.Resources; public abstract class GenericAction { protected RegexPanel m_panel; diff --git a/src/main/java/com/wyrdrune/regexplugin/actions/GenericToggleAction.java b/src/main/java/com/timindustries/regexpluginv2/actions/GenericToggleAction.java old mode 100755 new mode 100644 similarity index 78% rename from src/main/java/com/wyrdrune/regexplugin/actions/GenericToggleAction.java rename to src/main/java/com/timindustries/regexpluginv2/actions/GenericToggleAction.java index 136ded4..dab5a1f --- a/src/main/java/com/wyrdrune/regexplugin/actions/GenericToggleAction.java +++ b/src/main/java/com/timindustries/regexpluginv2/actions/GenericToggleAction.java @@ -1,8 +1,8 @@ -package com.wyrdrune.regexplugin.actions; +package com.timindustries.regexpluginv2.actions; import javax.swing.*; -import com.wyrdrune.regexplugin.RegexPanel; +import com.timindustries.regexpluginv2.RegexPanel; public abstract class GenericToggleAction extends GenericAction { protected GenericToggleAction(final RegexPanel panel, final String key, diff --git a/src/main/java/com/wyrdrune/regexplugin/actions/IdeaAction.java b/src/main/java/com/timindustries/regexpluginv2/actions/IdeaAction.java old mode 100755 new mode 100644 similarity index 88% rename from src/main/java/com/wyrdrune/regexplugin/actions/IdeaAction.java rename to src/main/java/com/timindustries/regexpluginv2/actions/IdeaAction.java index fa5133c..b9c43c2 --- a/src/main/java/com/wyrdrune/regexplugin/actions/IdeaAction.java +++ b/src/main/java/com/timindustries/regexpluginv2/actions/IdeaAction.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.actions; +package com.timindustries.regexpluginv2.actions; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; diff --git a/src/main/java/com/wyrdrune/regexplugin/actions/IdeaMenuAction.java b/src/main/java/com/timindustries/regexpluginv2/actions/IdeaMenuAction.java old mode 100755 new mode 100644 similarity index 88% rename from src/main/java/com/wyrdrune/regexplugin/actions/IdeaMenuAction.java rename to src/main/java/com/timindustries/regexpluginv2/actions/IdeaMenuAction.java index cd674c7..ca355c1 --- a/src/main/java/com/wyrdrune/regexplugin/actions/IdeaMenuAction.java +++ b/src/main/java/com/timindustries/regexpluginv2/actions/IdeaMenuAction.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.actions; +package com.timindustries.regexpluginv2.actions; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; diff --git a/src/main/java/com/wyrdrune/regexplugin/actions/ImportLibraryAction.java b/src/main/java/com/timindustries/regexpluginv2/actions/ImportLibraryAction.java old mode 100755 new mode 100644 similarity index 72% rename from src/main/java/com/wyrdrune/regexplugin/actions/ImportLibraryAction.java rename to src/main/java/com/timindustries/regexpluginv2/actions/ImportLibraryAction.java index 28b9dd5..4eedca6 --- a/src/main/java/com/wyrdrune/regexplugin/actions/ImportLibraryAction.java +++ b/src/main/java/com/timindustries/regexpluginv2/actions/ImportLibraryAction.java @@ -1,6 +1,6 @@ -package com.wyrdrune.regexplugin.actions; +package com.timindustries.regexpluginv2.actions; -import com.wyrdrune.regexplugin.RegexPanel; +import com.timindustries.regexpluginv2.RegexPanel; public class ImportLibraryAction extends GenericAction { diff --git a/src/main/java/com/wyrdrune/regexplugin/actions/ImportTextAction.java b/src/main/java/com/timindustries/regexpluginv2/actions/ImportTextAction.java old mode 100755 new mode 100644 similarity index 91% rename from src/main/java/com/wyrdrune/regexplugin/actions/ImportTextAction.java rename to src/main/java/com/timindustries/regexpluginv2/actions/ImportTextAction.java index 71dd35b..cd5bd2d --- a/src/main/java/com/wyrdrune/regexplugin/actions/ImportTextAction.java +++ b/src/main/java/com/timindustries/regexpluginv2/actions/ImportTextAction.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.actions; +package com.timindustries.regexpluginv2.actions; import java.io.File; import java.io.FileReader; @@ -9,9 +9,9 @@ import javax.swing.filechooser.FileFilter; import javax.swing.text.JTextComponent; -import com.wyrdrune.regexplugin.RegexPanel; -import com.wyrdrune.regexplugin.Utils; -import com.wyrdrune.regexplugin.ui.Resources; +import com.timindustries.regexpluginv2.RegexPanel; +import com.timindustries.regexpluginv2.Utils; +import com.timindustries.regexpluginv2.ui.Resources; public class ImportTextAction extends GenericAction { diff --git a/src/main/java/com/wyrdrune/regexplugin/actions/LibraryActor.java b/src/main/java/com/timindustries/regexpluginv2/actions/LibraryActor.java old mode 100755 new mode 100644 similarity index 86% rename from src/main/java/com/wyrdrune/regexplugin/actions/LibraryActor.java rename to src/main/java/com/timindustries/regexpluginv2/actions/LibraryActor.java index 3fea6c3..6cdc47e --- a/src/main/java/com/wyrdrune/regexplugin/actions/LibraryActor.java +++ b/src/main/java/com/timindustries/regexpluginv2/actions/LibraryActor.java @@ -1,13 +1,13 @@ -package com.wyrdrune.regexplugin.actions; +package com.timindustries.regexpluginv2.actions; import java.io.IOException; import javax.swing.*; -import com.wyrdrune.regexplugin.ExampleFileFilter; -import com.wyrdrune.regexplugin.LibraryManager; -import com.wyrdrune.regexplugin.Utils; -import com.wyrdrune.regexplugin.ui.Resources; +import com.timindustries.regexpluginv2.ExampleFileFilter; +import com.timindustries.regexpluginv2.LibraryManager; +import com.timindustries.regexpluginv2.Utils; +import com.timindustries.regexpluginv2.ui.Resources; public class LibraryActor { diff --git a/src/main/java/com/wyrdrune/regexplugin/actions/MatchToggleAction.java b/src/main/java/com/timindustries/regexpluginv2/actions/MatchToggleAction.java old mode 100755 new mode 100644 similarity index 73% rename from src/main/java/com/wyrdrune/regexplugin/actions/MatchToggleAction.java rename to src/main/java/com/timindustries/regexpluginv2/actions/MatchToggleAction.java index f57a4e2..b7e97e7 --- a/src/main/java/com/wyrdrune/regexplugin/actions/MatchToggleAction.java +++ b/src/main/java/com/timindustries/regexpluginv2/actions/MatchToggleAction.java @@ -1,10 +1,10 @@ -package com.wyrdrune.regexplugin.actions; +package com.timindustries.regexpluginv2.actions; import javax.swing.*; -import com.wyrdrune.regexplugin.MatchAction; -import com.wyrdrune.regexplugin.RegexPanel; -import com.wyrdrune.regexplugin.RegexPluginConfig; +import com.timindustries.regexpluginv2.MatchAction; +import com.timindustries.regexpluginv2.RegexPanel; +import com.timindustries.regexpluginv2.RegexPluginConfig; public abstract class MatchToggleAction extends GenericToggleAction { protected MatchAction fAction; diff --git a/src/main/java/com/wyrdrune/regexplugin/actions/NewLibraryEntryAction.java b/src/main/java/com/timindustries/regexpluginv2/actions/NewLibraryEntryAction.java old mode 100755 new mode 100644 similarity index 62% rename from src/main/java/com/wyrdrune/regexplugin/actions/NewLibraryEntryAction.java rename to src/main/java/com/timindustries/regexpluginv2/actions/NewLibraryEntryAction.java index b8cb7b8..b85b007 --- a/src/main/java/com/wyrdrune/regexplugin/actions/NewLibraryEntryAction.java +++ b/src/main/java/com/timindustries/regexpluginv2/actions/NewLibraryEntryAction.java @@ -1,7 +1,7 @@ -package com.wyrdrune.regexplugin.actions; +package com.timindustries.regexpluginv2.actions; -import com.wyrdrune.regexplugin.LibraryManager; -import com.wyrdrune.regexplugin.RegexPanel; +import com.timindustries.regexpluginv2.LibraryManager; +import com.timindustries.regexpluginv2.RegexPanel; public class NewLibraryEntryAction extends GenericAction { public NewLibraryEntryAction(final RegexPanel panel) { diff --git a/src/main/java/com/wyrdrune/regexplugin/actions/PasteRegexStringAction.java b/src/main/java/com/timindustries/regexpluginv2/actions/PasteRegexStringAction.java old mode 100755 new mode 100644 similarity index 96% rename from src/main/java/com/wyrdrune/regexplugin/actions/PasteRegexStringAction.java rename to src/main/java/com/timindustries/regexpluginv2/actions/PasteRegexStringAction.java index 277f7aa..a03e7de --- a/src/main/java/com/wyrdrune/regexplugin/actions/PasteRegexStringAction.java +++ b/src/main/java/com/timindustries/regexpluginv2/actions/PasteRegexStringAction.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.actions; +package com.timindustries.regexpluginv2.actions; import java.awt.*; import java.awt.datatransfer.DataFlavor; @@ -10,9 +10,9 @@ import javax.swing.text.JTextComponent; -import com.wyrdrune.regexplugin.MatchAction; -import com.wyrdrune.regexplugin.RegexPanel; -import com.wyrdrune.regexplugin.Utils; +import com.timindustries.regexpluginv2.MatchAction; +import com.timindustries.regexpluginv2.RegexPanel; +import com.timindustries.regexpluginv2.Utils; public class PasteRegexStringAction extends GenericAction { diff --git a/src/main/java/com/wyrdrune/regexplugin/actions/Regex2JavaString.java b/src/main/java/com/timindustries/regexpluginv2/actions/Regex2JavaString.java old mode 100755 new mode 100644 similarity index 96% rename from src/main/java/com/wyrdrune/regexplugin/actions/Regex2JavaString.java rename to src/main/java/com/timindustries/regexpluginv2/actions/Regex2JavaString.java index d6da7ab..fed3f98 --- a/src/main/java/com/wyrdrune/regexplugin/actions/Regex2JavaString.java +++ b/src/main/java/com/timindustries/regexpluginv2/actions/Regex2JavaString.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.actions; +package com.timindustries.regexpluginv2.actions; import java.util.ArrayList; import java.util.Collection; @@ -6,7 +6,7 @@ import java.util.StringTokenizer; import java.util.regex.Pattern; -import com.wyrdrune.regexplugin.Utils; +import com.timindustries.regexpluginv2.Utils; public class Regex2JavaString { public static String escape(final String s) { diff --git a/src/main/java/com/wyrdrune/regexplugin/actions/ReplaceAllAction.java b/src/main/java/com/timindustries/regexpluginv2/actions/ReplaceAllAction.java old mode 100755 new mode 100644 similarity index 69% rename from src/main/java/com/wyrdrune/regexplugin/actions/ReplaceAllAction.java rename to src/main/java/com/timindustries/regexpluginv2/actions/ReplaceAllAction.java index 68a7cba..5e29b1b --- a/src/main/java/com/wyrdrune/regexplugin/actions/ReplaceAllAction.java +++ b/src/main/java/com/timindustries/regexpluginv2/actions/ReplaceAllAction.java @@ -1,8 +1,8 @@ -package com.wyrdrune.regexplugin.actions; +package com.timindustries.regexpluginv2.actions; -import com.wyrdrune.regexplugin.IconCache; -import com.wyrdrune.regexplugin.MatchAction; -import com.wyrdrune.regexplugin.RegexPluginConfig; +import com.timindustries.regexpluginv2.IconCache; +import com.timindustries.regexpluginv2.MatchAction; +import com.timindustries.regexpluginv2.RegexPluginConfig; public class ReplaceAllAction extends MatchToggleAction { diff --git a/src/main/java/com/wyrdrune/regexplugin/actions/ShowHtmlAction.java b/src/main/java/com/timindustries/regexpluginv2/actions/ShowHtmlAction.java old mode 100755 new mode 100644 similarity index 94% rename from src/main/java/com/wyrdrune/regexplugin/actions/ShowHtmlAction.java rename to src/main/java/com/timindustries/regexpluginv2/actions/ShowHtmlAction.java index 75e42f5..2db0302 --- a/src/main/java/com/wyrdrune/regexplugin/actions/ShowHtmlAction.java +++ b/src/main/java/com/timindustries/regexpluginv2/actions/ShowHtmlAction.java @@ -2,7 +2,7 @@ * Copyright (c) 2004 Your Corporation. All Rights Reserved. */ -package com.wyrdrune.regexplugin.actions; +package com.timindustries.regexpluginv2.actions; import java.awt.*; import java.io.IOException; @@ -12,7 +12,7 @@ import javax.swing.event.HyperlinkListener; import javax.swing.text.html.HTMLEditorKit; -import com.wyrdrune.regexplugin.RegexPanel; +import com.timindustries.regexpluginv2.RegexPanel; public class ShowHtmlAction extends GenericAction { private final String fDocument; diff --git a/src/main/java/com/wyrdrune/regexplugin/actions/ToggleAutoUpdateAction.java b/src/main/java/com/timindustries/regexpluginv2/actions/ToggleAutoUpdateAction.java old mode 100755 new mode 100644 similarity index 68% rename from src/main/java/com/wyrdrune/regexplugin/actions/ToggleAutoUpdateAction.java rename to src/main/java/com/timindustries/regexpluginv2/actions/ToggleAutoUpdateAction.java index 9717d14..d388df7 --- a/src/main/java/com/wyrdrune/regexplugin/actions/ToggleAutoUpdateAction.java +++ b/src/main/java/com/timindustries/regexpluginv2/actions/ToggleAutoUpdateAction.java @@ -1,8 +1,8 @@ -package com.wyrdrune.regexplugin.actions; +package com.timindustries.regexpluginv2.actions; -import com.wyrdrune.regexplugin.IconCache; -import com.wyrdrune.regexplugin.MatchAction; -import com.wyrdrune.regexplugin.RegexPluginConfig; +import com.timindustries.regexpluginv2.IconCache; +import com.timindustries.regexpluginv2.MatchAction; +import com.timindustries.regexpluginv2.RegexPluginConfig; public class ToggleAutoUpdateAction extends MatchToggleAction { diff --git a/src/main/java/com/wyrdrune/regexplugin/actions/ToggleFlagAction.java b/src/main/java/com/timindustries/regexpluginv2/actions/ToggleFlagAction.java old mode 100755 new mode 100644 similarity index 74% rename from src/main/java/com/wyrdrune/regexplugin/actions/ToggleFlagAction.java rename to src/main/java/com/timindustries/regexpluginv2/actions/ToggleFlagAction.java index 40fe319..eb283fc --- a/src/main/java/com/wyrdrune/regexplugin/actions/ToggleFlagAction.java +++ b/src/main/java/com/timindustries/regexpluginv2/actions/ToggleFlagAction.java @@ -1,8 +1,8 @@ -package com.wyrdrune.regexplugin.actions; +package com.timindustries.regexpluginv2.actions; -import com.wyrdrune.regexplugin.IconCache; -import com.wyrdrune.regexplugin.MatchAction; -import com.wyrdrune.regexplugin.RegexPluginConfig; +import com.timindustries.regexpluginv2.IconCache; +import com.timindustries.regexpluginv2.MatchAction; +import com.timindustries.regexpluginv2.RegexPluginConfig; public class ToggleFlagAction extends MatchToggleAction { private final int flag; diff --git a/src/main/java/com/wyrdrune/regexplugin/actions/ToggleLabelsAction.java b/src/main/java/com/timindustries/regexpluginv2/actions/ToggleLabelsAction.java old mode 100755 new mode 100644 similarity index 74% rename from src/main/java/com/wyrdrune/regexplugin/actions/ToggleLabelsAction.java rename to src/main/java/com/timindustries/regexpluginv2/actions/ToggleLabelsAction.java index f12804a..8357f3a --- a/src/main/java/com/wyrdrune/regexplugin/actions/ToggleLabelsAction.java +++ b/src/main/java/com/timindustries/regexpluginv2/actions/ToggleLabelsAction.java @@ -1,7 +1,7 @@ -package com.wyrdrune.regexplugin.actions; +package com.timindustries.regexpluginv2.actions; -import com.wyrdrune.regexplugin.RegexPanel; -import com.wyrdrune.regexplugin.event.EventManager; +import com.timindustries.regexpluginv2.RegexPanel; +import com.timindustries.regexpluginv2.event.EventManager; public class ToggleLabelsAction extends GenericToggleAction { diff --git a/src/main/java/com/wyrdrune/regexplugin/event/EventManager.java b/src/main/java/com/timindustries/regexpluginv2/event/EventManager.java old mode 100755 new mode 100644 similarity index 98% rename from src/main/java/com/wyrdrune/regexplugin/event/EventManager.java rename to src/main/java/com/timindustries/regexpluginv2/event/EventManager.java index 6d67b37..fdf27e4 --- a/src/main/java/com/wyrdrune/regexplugin/event/EventManager.java +++ b/src/main/java/com/timindustries/regexpluginv2/event/EventManager.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.event; +package com.timindustries.regexpluginv2.event; import java.util.ArrayList; import java.util.Collection; @@ -7,7 +7,7 @@ import java.util.List; import java.util.Map; -import com.wyrdrune.regexplugin.Utils; +import com.timindustries.regexpluginv2.Utils; public class EventManager { protected final Map> m_listeners = diff --git a/src/main/java/com/timindustries/regexpluginv2/event/Notifiable.java b/src/main/java/com/timindustries/regexpluginv2/event/Notifiable.java new file mode 100644 index 0000000..79dd7f2 --- /dev/null +++ b/src/main/java/com/timindustries/regexpluginv2/event/Notifiable.java @@ -0,0 +1,4 @@ +package com.timindustries.regexpluginv2.event; + +public interface Notifiable { +} diff --git a/src/main/java/com/wyrdrune/regexplugin/event/ObjectEvent.java b/src/main/java/com/timindustries/regexpluginv2/event/ObjectEvent.java old mode 100755 new mode 100644 similarity index 93% rename from src/main/java/com/wyrdrune/regexplugin/event/ObjectEvent.java rename to src/main/java/com/timindustries/regexpluginv2/event/ObjectEvent.java index 6b559da..bda4c04 --- a/src/main/java/com/wyrdrune/regexplugin/event/ObjectEvent.java +++ b/src/main/java/com/timindustries/regexpluginv2/event/ObjectEvent.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.event; +package com.timindustries.regexpluginv2.event; import java.util.EventObject; diff --git a/src/main/java/com/wyrdrune/regexplugin/event/ObjectListener.java b/src/main/java/com/timindustries/regexpluginv2/event/ObjectListener.java old mode 100755 new mode 100644 similarity index 59% rename from src/main/java/com/wyrdrune/regexplugin/event/ObjectListener.java rename to src/main/java/com/timindustries/regexpluginv2/event/ObjectListener.java index be893cd..819a98b --- a/src/main/java/com/wyrdrune/regexplugin/event/ObjectListener.java +++ b/src/main/java/com/timindustries/regexpluginv2/event/ObjectListener.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.event; +package com.timindustries.regexpluginv2.event; public interface ObjectListener { void event(ObjectEvent event); diff --git a/src/main/java/com/wyrdrune/regexplugin/library/LibraryComboBoxModel.java b/src/main/java/com/timindustries/regexpluginv2/library/LibraryComboBoxModel.java old mode 100755 new mode 100644 similarity index 98% rename from src/main/java/com/wyrdrune/regexplugin/library/LibraryComboBoxModel.java rename to src/main/java/com/timindustries/regexpluginv2/library/LibraryComboBoxModel.java index daf3e05..15389ac --- a/src/main/java/com/wyrdrune/regexplugin/library/LibraryComboBoxModel.java +++ b/src/main/java/com/timindustries/regexpluginv2/library/LibraryComboBoxModel.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.library; +package com.timindustries.regexpluginv2.library; import java.io.Serializable; import java.util.Vector; diff --git a/src/main/java/com/wyrdrune/regexplugin/regexEditor/EditorTransferHandler.java b/src/main/java/com/timindustries/regexpluginv2/regexEditor/EditorTransferHandler.java old mode 100755 new mode 100644 similarity index 97% rename from src/main/java/com/wyrdrune/regexplugin/regexEditor/EditorTransferHandler.java rename to src/main/java/com/timindustries/regexpluginv2/regexEditor/EditorTransferHandler.java index 0207f38..4109697 --- a/src/main/java/com/wyrdrune/regexplugin/regexEditor/EditorTransferHandler.java +++ b/src/main/java/com/timindustries/regexpluginv2/regexEditor/EditorTransferHandler.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.regexEditor; +package com.timindustries.regexpluginv2.regexEditor; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.DataFlavor; @@ -16,8 +16,8 @@ import javax.swing.text.JTextComponent; import com.intellij.openapi.editor.RawText; -import com.wyrdrune.regexplugin.MatchAction; -import com.wyrdrune.regexplugin.actions.Regex2JavaString; +import com.timindustries.regexpluginv2.MatchAction; +import com.timindustries.regexpluginv2.actions.Regex2JavaString; public class EditorTransferHandler extends TransferHandler { private static final int BUF_SIZE = 1024; diff --git a/src/main/java/com/wyrdrune/regexplugin/regexEditor/ParenHighlighter.java b/src/main/java/com/timindustries/regexpluginv2/regexEditor/ParenHighlighter.java old mode 100755 new mode 100644 similarity index 99% rename from src/main/java/com/wyrdrune/regexplugin/regexEditor/ParenHighlighter.java rename to src/main/java/com/timindustries/regexpluginv2/regexEditor/ParenHighlighter.java index f8bfab0..7dec3fc --- a/src/main/java/com/wyrdrune/regexplugin/regexEditor/ParenHighlighter.java +++ b/src/main/java/com/timindustries/regexpluginv2/regexEditor/ParenHighlighter.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.regexEditor; +package com.timindustries.regexpluginv2.regexEditor; import java.awt.*; diff --git a/src/main/java/com/wyrdrune/regexplugin/regexEditor/RegexEditor.java b/src/main/java/com/timindustries/regexpluginv2/regexEditor/RegexEditor.java old mode 100755 new mode 100644 similarity index 71% rename from src/main/java/com/wyrdrune/regexplugin/regexEditor/RegexEditor.java rename to src/main/java/com/timindustries/regexpluginv2/regexEditor/RegexEditor.java index f9772ef..bd7cc9a --- a/src/main/java/com/wyrdrune/regexplugin/regexEditor/RegexEditor.java +++ b/src/main/java/com/timindustries/regexpluginv2/regexEditor/RegexEditor.java @@ -1,6 +1,6 @@ -package com.wyrdrune.regexplugin.regexEditor; +package com.timindustries.regexpluginv2.regexEditor; -import com.wyrdrune.regexplugin.MatchAction; +import com.timindustries.regexpluginv2.MatchAction; public class RegexEditor extends SyntaxHighlighter { diff --git a/src/main/java/com/wyrdrune/regexplugin/regexEditor/RegexScanner.java b/src/main/java/com/timindustries/regexpluginv2/regexEditor/RegexScanner.java old mode 100755 new mode 100644 similarity index 98% rename from src/main/java/com/wyrdrune/regexplugin/regexEditor/RegexScanner.java rename to src/main/java/com/timindustries/regexpluginv2/regexEditor/RegexScanner.java index b9ee3d7..fcb8979 --- a/src/main/java/com/wyrdrune/regexplugin/regexEditor/RegexScanner.java +++ b/src/main/java/com/timindustries/regexpluginv2/regexEditor/RegexScanner.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.regexEditor; +package com.timindustries.regexpluginv2.regexEditor; public class RegexScanner extends Scanner { diff --git a/src/main/java/com/wyrdrune/regexplugin/regexEditor/Scan.java b/src/main/java/com/timindustries/regexpluginv2/regexEditor/Scan.java old mode 100755 new mode 100644 similarity index 96% rename from src/main/java/com/wyrdrune/regexplugin/regexEditor/Scan.java rename to src/main/java/com/timindustries/regexpluginv2/regexEditor/Scan.java index aac08fa..5cccb8b --- a/src/main/java/com/wyrdrune/regexplugin/regexEditor/Scan.java +++ b/src/main/java/com/timindustries/regexpluginv2/regexEditor/Scan.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.regexEditor; +package com.timindustries.regexpluginv2.regexEditor; // Illustrate the use of the scanner by reading in a file and displaying its // tokens. diff --git a/src/main/java/com/wyrdrune/regexplugin/regexEditor/Scanner.java b/src/main/java/com/timindustries/regexpluginv2/regexEditor/Scanner.java old mode 100755 new mode 100644 similarity index 99% rename from src/main/java/com/wyrdrune/regexplugin/regexEditor/Scanner.java rename to src/main/java/com/timindustries/regexpluginv2/regexEditor/Scanner.java index 06d9f5e..0129e6a --- a/src/main/java/com/wyrdrune/regexplugin/regexEditor/Scanner.java +++ b/src/main/java/com/timindustries/regexpluginv2/regexEditor/Scanner.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.regexEditor; +package com.timindustries.regexpluginv2.regexEditor; /** */ diff --git a/src/main/java/com/wyrdrune/regexplugin/regexEditor/Symbol.java b/src/main/java/com/timindustries/regexpluginv2/regexEditor/Symbol.java old mode 100755 new mode 100644 similarity index 95% rename from src/main/java/com/wyrdrune/regexplugin/regexEditor/Symbol.java rename to src/main/java/com/timindustries/regexpluginv2/regexEditor/Symbol.java index b1deeba..f20b3a7 --- a/src/main/java/com/wyrdrune/regexplugin/regexEditor/Symbol.java +++ b/src/main/java/com/timindustries/regexpluginv2/regexEditor/Symbol.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.regexEditor; +package com.timindustries.regexpluginv2.regexEditor; /** * A Symbol represents the information shared between similar tokens, diff --git a/src/main/java/com/wyrdrune/regexplugin/regexEditor/SyntaxHighlighter.java b/src/main/java/com/timindustries/regexpluginv2/regexEditor/SyntaxHighlighter.java old mode 100755 new mode 100644 similarity index 98% rename from src/main/java/com/wyrdrune/regexplugin/regexEditor/SyntaxHighlighter.java rename to src/main/java/com/timindustries/regexpluginv2/regexEditor/SyntaxHighlighter.java index 2fa5639..d4fb55e --- a/src/main/java/com/wyrdrune/regexplugin/regexEditor/SyntaxHighlighter.java +++ b/src/main/java/com/timindustries/regexpluginv2/regexEditor/SyntaxHighlighter.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.regexEditor; +package com.timindustries.regexpluginv2.regexEditor; import java.awt.*; import java.io.IOException; @@ -14,7 +14,7 @@ import javax.swing.text.StyleConstants; import javax.swing.text.StyledDocument; -import com.wyrdrune.regexplugin.uiInterface.ComponentManager; +import com.timindustries.regexpluginv2.uiInterface.ComponentManager; /** * Display text with syntax highlighting. Highlighting is done with full diff --git a/src/main/java/com/wyrdrune/regexplugin/regexEditor/Token.java b/src/main/java/com/timindustries/regexpluginv2/regexEditor/Token.java old mode 100755 new mode 100644 similarity index 92% rename from src/main/java/com/wyrdrune/regexplugin/regexEditor/Token.java rename to src/main/java/com/timindustries/regexpluginv2/regexEditor/Token.java index b1a8fbb..70b763e --- a/src/main/java/com/wyrdrune/regexplugin/regexEditor/Token.java +++ b/src/main/java/com/timindustries/regexpluginv2/regexEditor/Token.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.regexEditor; +package com.timindustries.regexpluginv2.regexEditor; /** * A token represents a smallest meaningful fragment of text, such as a word, diff --git a/src/main/java/com/wyrdrune/regexplugin/regexEditor/TokenType.java b/src/main/java/com/timindustries/regexpluginv2/regexEditor/TokenType.java old mode 100755 new mode 100644 similarity index 97% rename from src/main/java/com/wyrdrune/regexplugin/regexEditor/TokenType.java rename to src/main/java/com/timindustries/regexpluginv2/regexEditor/TokenType.java index 9493b87..3578274 --- a/src/main/java/com/wyrdrune/regexplugin/regexEditor/TokenType.java +++ b/src/main/java/com/timindustries/regexpluginv2/regexEditor/TokenType.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.regexEditor; +package com.timindustries.regexpluginv2.regexEditor; /** * The TokenTypes interface defines the integer constants representing diff --git a/src/main/java/com/wyrdrune/regexplugin/ui/CheckBoxEx.java b/src/main/java/com/timindustries/regexpluginv2/ui/CheckBoxEx.java old mode 100755 new mode 100644 similarity index 87% rename from src/main/java/com/wyrdrune/regexplugin/ui/CheckBoxEx.java rename to src/main/java/com/timindustries/regexpluginv2/ui/CheckBoxEx.java index 8e2378e..84cd976 --- a/src/main/java/com/wyrdrune/regexplugin/ui/CheckBoxEx.java +++ b/src/main/java/com/timindustries/regexpluginv2/ui/CheckBoxEx.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.ui; +package com.timindustries.regexpluginv2.ui; import javax.swing.*; diff --git a/src/main/java/com/wyrdrune/regexplugin/ui/LabelEx.java b/src/main/java/com/timindustries/regexpluginv2/ui/LabelEx.java old mode 100755 new mode 100644 similarity index 85% rename from src/main/java/com/wyrdrune/regexplugin/ui/LabelEx.java rename to src/main/java/com/timindustries/regexpluginv2/ui/LabelEx.java index e28a036..c3629aa --- a/src/main/java/com/wyrdrune/regexplugin/ui/LabelEx.java +++ b/src/main/java/com/timindustries/regexpluginv2/ui/LabelEx.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.ui; +package com.timindustries.regexpluginv2.ui; import javax.swing.*; diff --git a/src/main/java/com/wyrdrune/regexplugin/ui/MenuEx.java b/src/main/java/com/timindustries/regexpluginv2/ui/MenuEx.java old mode 100755 new mode 100644 similarity index 87% rename from src/main/java/com/wyrdrune/regexplugin/ui/MenuEx.java rename to src/main/java/com/timindustries/regexpluginv2/ui/MenuEx.java index 556f06b..0e0df88 --- a/src/main/java/com/wyrdrune/regexplugin/ui/MenuEx.java +++ b/src/main/java/com/timindustries/regexpluginv2/ui/MenuEx.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.ui; +package com.timindustries.regexpluginv2.ui; import javax.swing.*; diff --git a/src/main/java/com/wyrdrune/regexplugin/ui/MenuItemEx.java b/src/main/java/com/timindustries/regexpluginv2/ui/MenuItemEx.java old mode 100755 new mode 100644 similarity index 74% rename from src/main/java/com/wyrdrune/regexplugin/ui/MenuItemEx.java rename to src/main/java/com/timindustries/regexpluginv2/ui/MenuItemEx.java index 3d86096..ac38788 --- a/src/main/java/com/wyrdrune/regexplugin/ui/MenuItemEx.java +++ b/src/main/java/com/timindustries/regexpluginv2/ui/MenuItemEx.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.ui; +package com.timindustries.regexpluginv2.ui; import javax.swing.*; diff --git a/src/main/java/com/wyrdrune/regexplugin/ui/Resources.java b/src/main/java/com/timindustries/regexpluginv2/ui/Resources.java old mode 100755 new mode 100644 similarity index 97% rename from src/main/java/com/wyrdrune/regexplugin/ui/Resources.java rename to src/main/java/com/timindustries/regexpluginv2/ui/Resources.java index da90fb2..52f0162 --- a/src/main/java/com/wyrdrune/regexplugin/ui/Resources.java +++ b/src/main/java/com/timindustries/regexpluginv2/ui/Resources.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.ui; +package com.timindustries.regexpluginv2.ui; import java.text.MessageFormat; import java.util.MissingResourceException; diff --git a/src/main/java/com/wyrdrune/regexplugin/uiInterface/ComponentFactory.java b/src/main/java/com/timindustries/regexpluginv2/uiInterface/ComponentFactory.java similarity index 76% rename from src/main/java/com/wyrdrune/regexplugin/uiInterface/ComponentFactory.java rename to src/main/java/com/timindustries/regexpluginv2/uiInterface/ComponentFactory.java index 875953b..6213830 100644 --- a/src/main/java/com/wyrdrune/regexplugin/uiInterface/ComponentFactory.java +++ b/src/main/java/com/timindustries/regexpluginv2/uiInterface/ComponentFactory.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.uiInterface; +package com.timindustries.regexpluginv2.uiInterface; public class ComponentFactory { private ComponentFactory() { diff --git a/src/main/java/com/wyrdrune/regexplugin/uiInterface/ComponentManager.java b/src/main/java/com/timindustries/regexpluginv2/uiInterface/ComponentManager.java old mode 100755 new mode 100644 similarity index 96% rename from src/main/java/com/wyrdrune/regexplugin/uiInterface/ComponentManager.java rename to src/main/java/com/timindustries/regexpluginv2/uiInterface/ComponentManager.java index 4d7c9df..2d6a697 --- a/src/main/java/com/wyrdrune/regexplugin/uiInterface/ComponentManager.java +++ b/src/main/java/com/timindustries/regexpluginv2/uiInterface/ComponentManager.java @@ -1,4 +1,4 @@ -package com.wyrdrune.regexplugin.uiInterface; +package com.timindustries.regexpluginv2.uiInterface; import java.awt.*; import java.util.ArrayList; @@ -22,10 +22,10 @@ import com.intellij.openapi.editor.colors.TextAttributesKey; import com.intellij.openapi.editor.markup.TextAttributes; import com.intellij.ui.components.JBScrollPane; -import com.wyrdrune.regexplugin.RegexPanel; -import com.wyrdrune.regexplugin.actions.*; -import com.wyrdrune.regexplugin.regexEditor.TokenType; -import com.wyrdrune.regexplugin.ui.Resources; +import com.timindustries.regexpluginv2.RegexPanel; +import com.timindustries.regexpluginv2.actions.*; +import com.timindustries.regexpluginv2.regexEditor.TokenType; +import com.timindustries.regexpluginv2.ui.Resources; class MenuAction extends AnAction { private JPopupMenu menu; diff --git a/src/main/java/com/wyrdrune/regexplugin/event/Notifiable.java b/src/main/java/com/wyrdrune/regexplugin/event/Notifiable.java deleted file mode 100755 index ba3668f..0000000 --- a/src/main/java/com/wyrdrune/regexplugin/event/Notifiable.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.wyrdrune.regexplugin.event; - -public interface Notifiable { -} diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 7792049..6b1d3ee 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -1,10 +1,10 @@ - com.wyrdrune.regexplugin - RegexPlugin - Guy Gascoigne-Piggford + com.timindustries.regexpluginv2 + RegexPluginV2 + Tim Gallois com.intellij.modules.platform + factoryClass="com.timindustries.regexpluginv2.RegexPluginToolWindowFactory"/> diff --git a/src/main/resources/help/About.html b/src/main/resources/help/About.html index 9c1cba6..b598a51 100755 --- a/src/main/resources/help/About.html +++ b/src/main/resources/help/About.html @@ -37,33 +37,33 @@ Plugin: - @PLUGIN.TITLE@ + RegexPlugin2 Version: - @PLUGIN.VERSION.LONG@ + 1.0 Author: - @PLUGIN.VENDOR@ + Tim Gallois + + + + + Author of original RegexPlugin: + Guy Gascoigne-Piggford Description: - @PLUGIN.DESCRIPTION@ + A revival of the original Regex Plugin for IntelliJ. Now works with newer versions, and with some added QOL features. - - - Download: - @PLUGIN.URL@ - - diff --git a/src/main/resources/help/reference.html b/src/main/resources/help/reference.html index 6308164..293f3a8 100755 --- a/src/main/resources/help/reference.html +++ b/src/main/resources/help/reference.html @@ -1,705 +1,188 @@ - - - Regular Expression Quick Reference - -

Regular Expression Quick Reference

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ConstructMatches
 
Characters
xThe character x
\\The backslash character
\0nThe character with octal value 0n (0 <= n <= 7) -
\0nnThe character with octal value 0nn (0 <= n <= 7) -
\0mnnThe character with octal value 0mnn (0 <= m <= 3, - 0 <= n <= 7) -
\xhhThe character with hexadecimal value 0xhh
\uhhhhThe character with hexadecimal value 0xhhhh
\tThe tab character ('\u0009')
\nThe newline (line feed) character ('\u000A')
\rThe carriage-return character ('\u000D')
\fThe form-feed character ('\u000C')
\aThe alert (bell) character ('\u0007')
\eThe escape character ('\u001B')
\cxThe control character corresponding to x
 
Character classes
[abc]a, b, or c (simple class)
[^abc]Any character except a, b, or c (negation)
[a-zA-Z]a through z or A through Z, inclusive - (range) -
[a-d[m-p]]a through d, or m through p: [a-dm-p] - (union) -
[a-z&&[def]]d, e, or f (intersection) -
[a-z&&[^bc]]a through z, except for b and c: [ad-z] - (subtraction) -
[a-z&&[^m-p]]a through z, and not m through p: - [a-lq-z](subtraction) -
 
Predefined character classes
.Any character (may or may not match line terminators)
\dA digit: [0-9]
\DA non-digit: [^0-9]
\sA whitespace character: [ \t\n\x0B\f\r]
\SA non-whitespace character: [^\s]
\wA word character: [a-zA-Z_0-9]
\WA non-word character: [^\w]
 
POSIX character classes (US-ASCII - only) -
\p{Lower}A lower-case alphabetic character: [a-z]
\p{Upper}An upper-case alphabetic character:[A-Z]
\p{ASCII}All ASCII:[\x00-\x7F]
\p{Alpha}An alphabetic character:[\p{Lower}\p{Upper}]
\p{Digit}A decimal digit: [0-9]
\p{Alnum}An alphanumeric character:[\p{Alpha}\p{Digit}]
\p{Punct} - Punctuation: One of !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
\p{Graph}A visible character: [\p{Alnum}\p{Punct}]
\p{Print}A printable character: [\p{Graph}]
\p{Blank}A space or a tab: [ \t]
\p{Cntrl}A control character: [\x00-\x1F\x7F]
\p{XDigit}A hexadecimal digit: [0-9a-fA-F]
\p{Space}A whitespace character: [ \t\n\x0B\f\r]
 
Classes for Unicode blocks and categories
\p{InGreek}A character in the Greek block (simple block)
\p{Lu}An uppercase letter (simple category)
\p{Sc}A currency symbol
^\P{InGreek}Any character except one in the Greek block (negation)
[\p{L}&&[^\p{Lu}]] Any letter except an uppercase letter (subtraction)
 
Boundary matchers
^The beginning of a line
$The end of a line
\bA word boundary
\BA non-word boundary
\AThe beginning of the input
\GThe end of the previous match
\ZThe end of the input but for the final terminator, if any
\zThe end of the input
 
Greedy quantifiers
X?X, once or not at all
X*X, zero or more times
X+X, one or more times
X{n}X, exactly n times
X{n,}X, at least n times
X{n,m}X, at least n but not more than m times
 
Reluctant quantifiers
X??X, once or not at all
X*?X, zero or more times
X+?X, one or more times
X{n}?X, exactly n times
X{n,}?X, at least n times
X{n,m}?X, at least n but not more than m times
 
Possessive quantifiers
X?+X, once or not at all
X*+X, zero or more times
X++X, one or more times
X{n}+X, exactly n times
X{n,}+X, at least n times
X{n,m}+X, at least n but not more than m times
 
Logical operators
XYX followed by Y
X|YEither X or Y
(X)X, as a capturing group
 
Back references
\nWhatever the nth capturing group matched
 
Quotation
\Nothing, but quotes the following character
\QNothing, but quotes all characters until \E
\ENothing, but ends quoting started by \Q
 
Special constructs (non-capturing)
(?:X)X, as a non-capturing group
(?idmsux-idmsux) Nothing, but turns match flags on - off
(?idmsux-idmsux:X)  X, as a non-capturing group with the given flags on - off
(?=X)X, via zero-width positive lookahead
(?!X)X, via zero-width negative lookahead
(?<=X)X, via zero-width positive lookbehind
(?<!X)X, via zero-width negative lookbehind
(?>X)X, as an independent, non-capturing group
-
- -

Backslashes, escapes, and quoting

- -

The backslash character ('\') serves to introduce escaped constructs, - as defined in the table above, as well as to quote characters that otherwise - would be interpreted as unescaped constructs. Thus the expression \\ - matches a single backslash and \{ matches a left brace. - -

It is an error to use a backslash prior to any alphabetic character that does - not denote an escaped construct; these are reserved for future extensions to - the regular-expression language. A backslash may be used prior to a non-alphabetic - character regardless of whether that character is part of an unescaped construct. - -

Backslashes within string literals in Java source code are interpreted as required - by the Java Language Specification as either Unicode escapes or other character - escapes. It is therefore necessary to double backslashes in string literals - that represent regular expressions to protect them from interpretation by the - Java bytecode compiler. The string literal "\b", for example, matches - a single backspace character when interpreted as a regular expression, while - "\\b" matches a word boundary. The string literal "\(hello\)" - is illegal and leads to a compile-time error; in order to match the string (hello) - the string literal "\\(hello\\)" must be used.

-

Character Classes

- -

Character classes may appear within other character classes, and may be composed - by the union operator (implicit) and the intersection operator (&&). - The union operator denotes a class that contains every character that is in - at least one of its operand classes. The intersection operator denotes a class - that contains every character that is in both of its operand classes. - -

The precedence of character-class operators is as follows, from highest to - lowest: -

- + +
+
+ - - - + - - - + + - - - + + - - - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -
1    Literal escape    \xCharacter classes
2    Grouping[...] + . + any character except newline
3    Rangea-z + \w + \d + \s + word, digit, whitespace
4    Union[a-e][i-u] + \W + \D + \S + not word, digit, whitespace
5    Intersection[a-z&&[aeiou]] + [abc] + any of a, b, or c
+ [^abc] + not a, b, or c
+ [a-g] + character between a & g
Anchors
+ ^abc$ + start / end of the string
+ \b + \B + word, not-word boundary
Escaped characters
+ \. + \* + \\ + escaped special characters
+ \t + \n + \r + tab, linefeed, carriage return
Groups & Lookaround
+ (abc) + capture group
+ \1 + backreference to group #1
+ (?:abc) + non-capturing group
-
-

Note that a different set of metacharacters are in effect inside a character - class than outside a character class. For instance, the regular expression . - loses its special meaning inside a character class, while the expression - - becomes a range forming metacharacter.

-

Line terminators

- -

A line terminator is a one- or two-character sequence that marks the - end of a line of the input character sequence. The following are recognized - as line terminators: -

    -
  • A newline (line feed) character ('\n'), -
  • A carriage-return character followed immediately by a newline character ("\r\n"), -
  • A standalone carriage-return character ('\r'), -
  • A next-line character ('\u0085'), -
  • A line-separator character ('\u2028'), or -
  • A paragraph-separator character ('\u2029). -
-

If UNIX_LINES mode is activated, then the only line terminators - recognized are newline characters. - -

The regular expression . matches any character except a line terminator - unless the DOTALL flag is specified. - -

By default, the regular expressions ^ and $ ignore line - terminators and only match at the beginning and the end, respectively, of the - entire input sequence. If MULTILINE mode is activated then ^ - matches at the beginning of input and after any line terminator except at the - end of input. When in MULTILINE mode $ matches just before - a line terminator or the end of the input sequence.

-

Groups and capturing

- -

Capturing groups are numbered by counting their opening parentheses from left - to right. In the expression ((A)(B(C))), for example, there are four - such groups:

-
- - - + + - - + + - - + - - + + + + + + + + + + + + + + + + + + +
1    ((A)(B(C))) + (?=abc) + positive lookahead
2    (A) + (?!abc) + negative lookahead
3    (B(C))Quantifiers & Alternation
4    (C) + a* + a+ + a? + 0 or more, 1 or more, 0 or 1
+ a{5} + a{2,} + exactly five, two or more
+ a{1,3} + between one & three
+ a+? + a{2,}? + match as few as possible
+ ab|cd + match ab or cd
-
-

Group zero always stands for the entire expression. - -

Capturing groups are so named because, during a match, each subsequence of - the input sequence that matches such a group is saved. The captured subsequence - may be used later in the expression, via a back reference, and may also be retrieved - from the matcher once the match operation is complete (e.g. $0, $1, $2, ... - can be used to use a captured group as replacement). - -

The captured input associated with a group is always the subsequence that - the group most recently matched. If a group is evaluated a second time because - of quantification then its previously-captured value, if any, will be retained - if the second evaluation fails. Matching the string "aba" against the - expression (a(b)?)+, for example, leaves group two set to "b". - All captured input is discarded at the beginning of each match. - -

Groups beginning with (? are pure, non-capturing groups that - do not capture text and do not count towards the group total.

- -

Replacement

- -

The replacement string may contain references to subsequences captured - during the previous match: Each occurrence of $g will be replaced by the - result of evaluating group(g). The first number after the $ is always - treated as part of the group reference. Subsequent numbers are incorporated - into g if they would form a legal group reference. Only the numerals '0' - through '9' are considered as potential components of the group reference. - If the second group matched the string "foo", for example, then passing the - replacement string "$2bar" would cause "foobar" to be appended to the string - buffer. A dollar sign ($) may be included as a literal in the replacement - string by preceding it with a backslash (\$).

- -

Capturing groups are indexed from left to right, starting at one. Group - zero denotes the entire pattern.

- -

Unicode support

- -

This class follows Unicode Technical Report #18: Unicode Regular Expression - Guidelines, implementing its second level of support though with a slightly - different concrete syntax. - -

Unicode escape sequences such as \u2014 in Java source code are - processed as described in ?3.3 of the Java Language Specification. Such escape - sequences are also implemented directly by the regular-expression parser so - that Unicode escapes can be used in expressions that are read from files or - from the keyboard. Thus the strings "\u2014" and "\\u2014", - while not equal, compile into the same pattern, which matches the character - with hexadecimal value 0x2014. -

Unicode blocks and categories are written with the \p and \P - constructs as in Perl. \p{prop} matches if the input - has the property prop, while \P{prop} does not match - if the input has that property. Blocks are specified with the prefix In, - as in InMongolian. Categories may be specified with the optional prefix - Is: Both \p{L} and \p{IsL} denote the category of - Unicode letters. Blocks and categories can be used both inside and outside of - a character class. - -

The supported blocks and categories are those of The Unicode Standard, - Version 3.0. The block names are those defined in Chapter 14 and - in the file Blocks-3.txt of the Unicode Character Database except that the spaces - are removed; "Basic Latin", for example, becomes "BasicLatin". - The category names are those defined in table 4-5 of the Standard (p. 88), - both normative and informative.

-

Comparison to Perl 5

- -

Perl constructs not supported by this class:

-
    -
  • -

    The conditional constructs (?{X}) and - (?(condition)X|Y), -

    -
  • -
  • -

    The embedded code constructs (?{code}) and - (??{code}),

    -
  • -
  • -

    The embedded comment syntax (?#comment), and

    -
  • -
  • -

    The preprocessing operations \l \u, \L, - and \U.

    -
  • -
-

Constructs supported by this class but not by Perl:

-
-

Notable differences from Perl:

-
    -
  • -

    In Perl, \1 through \9 are always interpreted as back - references; a backslash-escaped number greater than 9 is treated - as a back reference if at least that many subexpressions exist, otherwise - it is interpreted, if possible, as an octal escape. In this class octal - escapes must always begin with a zero. In this class, \1 through - \9 are always interpreted as back references, and a larger number - is accepted as a back reference if at least that many subexpressions exist - at that point in the regular expression, otherwise the parser will drop - digits until the number is smaller or equal to the existing number of groups - or it is one digit.

    -
  • -
  • -

    Perl uses the g flag to request a match that resumes where the - last match left off. This functionality is provided implicitly by the Matcher - class: Repeated invocations of the find method will resume - where the last match left off, unless the matcher is reset.

    -
  • -
  • -

    In Perl, embedded flags at the top level of an expression affect the whole - expression. In this class, embedded flags always take effect at the point - at which they appear, whether they are at the top level or within a group; - in the latter case, flags are restored at the end of the group just as in - Perl.

    -
  • -
  • -

    Perl is forgiving about malformed matching constructs, as in the expression - *a, as well as dangling brackets, as in the expression abc], - and treats them as literals. This class also accepts dangling brackets but - is strict about dangling metacharacters like +, ? and *, and will throw - a PatternSyntaxException if it encounters them.

    -
  • -
-

For a more precise description of the behavior of regular expression constructs, - please see "http://www.oreilly.com/catalog/regex2/" Mastering Regular Expressions, - 2nd Edition, Jeffrey E. F. Friedl, O'Reilly and Associates, 2002.

- -

This text is a subset of the Java 1.4 Pattern JavaDoc

- + + \ No newline at end of file