summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorCheng Chen2012-04-26 04:18:40 (EDT)
committer Cheng Chen2012-04-26 04:18:40 (EDT)
commit6dbb3c67809b3db88760bf2d3f50bd3c8d3b8244 (patch)
tree062e9da0c8f6678648451a49d078ffe282b589cd
parentb528990b64c751a6341d7709a079073ab47640aa (diff)
downloadorg.eclipse.recommenders-6dbb3c67809b3db88760bf2d3f50bd3c8d3b8244.zip
org.eclipse.recommenders-6dbb3c67809b3db88760bf2d3f50bd3c8d3b8244.tar.gz
org.eclipse.recommenders-6dbb3c67809b3db88760bf2d3f50bd3c8d3b8244.tar.bz2
Correct Gerrit patch (Re-use existing change-id test):refs/changes/60/5660/2
add project .classpath and .project file, change commends id prefix, remove SnipMatch menu and add popup menu in JDT editor I confirm: 1.authored 100% the content they are contributing 2.have the rights to donate the content to EPL 3.contribute the content under the EPL Signed-off-by: Cheng Chen <chengchendoc@gmail.com> Change-Id: Iad7c0333c93c1a4efbbfe336dc40d89267ecfb1e
-rw-r--r--plugins/org.eclipse.recommenders.snipmatch.rcp/.classpath7
-rw-r--r--plugins/org.eclipse.recommenders.snipmatch.rcp/.project28
-rw-r--r--plugins/org.eclipse.recommenders.snipmatch.rcp/plugin.xml223
-rw-r--r--[-rwxr-xr-x]plugins/org.eclipse.recommenders.snipmatch.rcp/src/org/eclipse/recommenders/snipmatch/rcp/CommandHandler.java12
4 files changed, 215 insertions, 55 deletions
diff --git a/plugins/org.eclipse.recommenders.snipmatch.rcp/.classpath b/plugins/org.eclipse.recommenders.snipmatch.rcp/.classpath
new file mode 100644
index 0000000..8a8f166
--- /dev/null
+++ b/plugins/org.eclipse.recommenders.snipmatch.rcp/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.recommenders.snipmatch.rcp/.project b/plugins/org.eclipse.recommenders.snipmatch.rcp/.project
new file mode 100644
index 0000000..4e1c94f
--- /dev/null
+++ b/plugins/org.eclipse.recommenders.snipmatch.rcp/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.recommenders.snipmatch.rcp</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.recommenders.snipmatch.rcp/plugin.xml b/plugins/org.eclipse.recommenders.snipmatch.rcp/plugin.xml
index ab5f029..8bd4cca 100644
--- a/plugins/org.eclipse.recommenders.snipmatch.rcp/plugin.xml
+++ b/plugins/org.eclipse.recommenders.snipmatch.rcp/plugin.xml
@@ -1,71 +1,196 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
- <extension point="org.eclipse.ui.commands">
- <command id="snipmatch.eclipse.commands.search" name="Search">
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ id="org.eclipse.snipmatch.commands.search"
+ name="Search">
</command>
- <command id="snipmatch.eclipse.commands.login" name="Login">
+ <command
+ id="org.eclipse.snipmatch.commands.submit"
+ name="Submit">
</command>
- <command id="snipmatch.eclipse.commands.logout" name="Logout">
+ <command
+ id="org.eclipse.snipmatch.commands.profile"
+ name="Profile">
</command>
- <command id="snipmatch.eclipse.commands.remind" name="Remind">
+ <command
+ id="org.eclipse.snipmatch.commands.login"
+ name="Login">
+ </command>
+ <command
+ id="org.eclipse.snipmatch.commands.logout"
+ name="Logout">
+ </command>
+ <command
+ id="org.eclipse.snipmatch.commands.remind"
+ name="Remind">
</command>
</extension>
- <extension point="org.eclipse.ui.handlers">
- <handler class="org.eclipse.recommenders.snipmatch.rcp.CommandHandler" commandId="snipmatch.eclipse.commands.login">
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.recommenders.snipmatch.rcp.CommandHandler"
+ commandId="org.eclipse.snipmatch.commands.login">
+ </handler>
+ <handler
+ class="org.eclipse.recommenders.snipmatch.rcp.CommandHandler"
+ commandId="org.eclipse.snipmatch.commands.search">
+ </handler>
+ <handler
+ class="org.eclipse.recommenders.snipmatch.rcp.CommandHandler"
+ commandId="org.eclipse.snipmatch.commands.submit">
</handler>
- <handler class="org.eclipse.recommenders.snipmatch.rcp.CommandHandler" commandId="snipmatch.eclipse.commands.search">
+ <handler
+ class="org.eclipse.recommenders.snipmatch.rcp.CommandHandler"
+ commandId="org.eclipse.snipmatch.commands.profile">
</handler>
- <handler class="org.eclipse.recommenders.snipmatch.rcp.CommandHandler" commandId="snipmatch.eclipse.commands.logout">
+ <handler
+ class="org.eclipse.recommenders.snipmatch.rcp.CommandHandler"
+ commandId="org.eclipse.snipmatch.commands.logout">
<enabledWhen>
- <iterate operator="or">
- <test forcePluginActivation="true" property="snipmatch.eclipse.ui.props.signedin" value="true">
+ <iterate
+ operator="or">
+ <test
+ forcePluginActivation="true"
+ property="snipmatch.eclipse.ui.props.signedin"
+ value="true">
</test>
</iterate>
</enabledWhen>
</handler>
- <handler class="org.eclipse.recommenders.snipmatch.rcp.CommandHandler" commandId="snipmatch.eclipse.commands.remind">
+ <handler
+ class="org.eclipse.recommenders.snipmatch.rcp.CommandHandler"
+ commandId="org.eclipse.snipmatch.commands.remind">
</handler>
</extension>
- <extension point="org.eclipse.ui.menus">
- <menuContribution allPopups="false" locationURI="menu:org.eclipse.ui.main.menu">
- <menu id="snipmatch.eclipse.menu" label="SnipMatch">
- <command commandId="snipmatch.eclipse.commands.search" label="Search for Snippets" style="push">
- </command>
- <separator name="Separator" visible="true">
- </separator>
- <command commandId="snipmatch.eclipse.commands.login" label="Sign In as a Different User" style="push">
- </command>
- <command commandId="snipmatch.eclipse.commands.logout" label="Sign Out" style="push">
- </command>
- </menu>
- </menuContribution>
- </extension>
- <extension point="org.eclipse.ui.bindings">
- <key commandId="snipmatch.eclipse.commands.search" contextId="org.eclipse.ui.textEditorScope" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" sequence="M1+Enter">
+ <extension
+ point="org.eclipse.ui.bindings">
+ <key
+ commandId="org.eclipse.snipmatch.commands.search"
+ contextId="org.eclipse.ui.textEditorScope"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="M1+Enter">
</key>
</extension>
- <extension point="org.eclipse.core.expressions.propertyTesters">
- <propertyTester class="org.eclipse.recommenders.snipmatch.rcp.SignInStatusTester" id="snipmatch.eclipse.ui.signintester" namespace="snipmatch.eclipse.ui.props" properties="signedin" type="java.lang.Object">
+ <extension
+ point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.eclipse.recommenders.snipmatch.rcp.SignInStatusTester"
+ id="snipmatch.eclipse.ui.signintester"
+ namespace="snipmatch.eclipse.ui.props"
+ properties="signedin"
+ type="java.lang.Object">
</propertyTester>
</extension>
- <extension point="org.eclipse.ui.startup">
- <startup/>
- </extension>
- <extension point="org.eclipse.ui.preferencePages">
- <page class="org.eclipse.recommenders.snipmatch.preferences.SnipMatchPreferencePage" id="org.eclipse.recommenders.snipmatch.preferences.SnipMatchPreferencePage" category="org.eclipse.recommenders.rcp.category.preferences" name="SnipMatch">
- </page>
- <page class="org.eclipse.recommenders.snipmatch.preferences.SnipMatchLocalSettingPreferencePage" id="org.eclipse.recommenders.snipmatch.preferences.SnipMatchGeneralPreferencePage" category="org.eclipse.recommenders.snipmatch.preferences.SnipMatchPreferencePage" name="Local Setting">
- </page>
- <page class="org.eclipse.recommenders.snipmatch.preferences.SnipMatchRemoteSettingPreferencePage" id="org.eclipse.recommenders.snipmatch.preferences.RemoteSettingPreferencePage" category="org.eclipse.recommenders.snipmatch.preferences.SnipMatchPreferencePage" name="Remote Setting">
- </page>
- </extension>
- <extension point="org.eclipse.core.runtime.preferences">
- <initializer class="org.eclipse.recommenders.snipmatch.preferences.PreferenceInitializer">
- </initializer>
- <initializer class="org.eclipse.recommenders.snipmatch.preferences.PreferenceInitializer">
- </initializer>
- <initializer class="org.eclipse.recommenders.snipmatch.preferences.PreferenceInitializer">
- </initializer>
+ <extension
+ point="org.eclipse.ui.startup">
+ <startup></startup>
</extension>
-</plugin> \ No newline at end of file
+ <extension point="org.eclipse.ui.themes">
+ <themeElementCategory
+ id="org.eclipse.recommenders.snipmatch.preferences.themeElementCategory"
+ label="Code Recommenders SnipMatch">
+ <description>
+ Code Recommenders SnipMatch theme category
+ </description>
+ </themeElementCategory>
+ <colorDefinition
+ categoryId="org.eclipse.recommenders.snipmatch.preferences.themeElementCategory"
+ id="org.eclipse.recommenders.snipmatch.preferences.colorDefinition.queryBackColor"
+ label="Query Back Color"
+ value="255, 255, 200">
+ <description>
+ SnipMatch search box query back color
+ </description>
+ </colorDefinition>
+ <colorDefinition
+ categoryId="org.eclipse.recommenders.snipmatch.preferences.themeElementCategory"
+ id="org.eclipse.recommenders.snipmatch.preferences.colorDefinition.matchSelectBackColor"
+ label="Match Select Back Color"
+ value="255, 255, 255">
+ <description>
+ SnipMatch search box match select back color
+ </description>
+ </colorDefinition>
+ <colorDefinition
+ categoryId="org.eclipse.recommenders.snipmatch.preferences.themeElementCategory"
+ id="org.eclipse.recommenders.snipmatch.preferences.colorDefinition.selectionOverviewBackColor"
+ label="Match Select Overview Back Color"
+ value="255, 255, 225">
+ <description>
+ SnipMatch search box match select overview panel back color
+ </description>
+ </colorDefinition>
+ <colorDefinition
+ categoryId="org.eclipse.recommenders.snipmatch.preferences.themeElementCategory"
+ id="org.eclipse.recommenders.snipmatch.preferences.colorDefinition.matchBlankArgForeColor"
+ label="Match Blank Arg Fore Color"
+ value="125, 150, 255">
+ <description>
+ SnipMatch search box match blank argement fore color
+ </description>
+ </colorDefinition>
+ <colorDefinition
+ categoryId="org.eclipse.recommenders.snipmatch.preferences.themeElementCategory"
+ id="org.eclipse.recommenders.snipmatch.preferences.colorDefinition.queryDisabledBackColor"
+ label="Query Disable Back Color"
+ value="240, 240, 240">
+ <description>
+ SnipMatch search box query disable back color
+ </description>
+ </colorDefinition>
+ <colorDefinition
+ categoryId="org.eclipse.recommenders.snipmatch.preferences.themeElementCategory"
+ id="org.eclipse.recommenders.snipmatch.preferences.colorDefinition.matchKeywordForeColor"
+ label="Match Keyword Fore Color"
+ value="0, 0, 0">
+ <description>
+ SnipMatch search box match keyword fore color
+ </description>
+ </colorDefinition>
+ <colorDefinition
+ categoryId="org.eclipse.recommenders.snipmatch.preferences.themeElementCategory"
+ id="org.eclipse.recommenders.snipmatch.preferences.colorDefinition.matchArgForeColor"
+ label="Match Arg Fore Color"
+ value="0, 0, 255">
+ <description>
+ SnipMatch search box match argement fore color
+ </description>
+ </colorDefinition>
+ <fontDefinition
+ categoryId="org.eclipse.recommenders.snipmatch.preferences.themeElementCategory"
+ id="org.eclipse.recommenders.snipmatch.preferences.fontDefinition"
+ label="SnipMatch Search Font"
+ defaultsTo="org.eclipse.jface.textfont">
+ <description>
+ SnipMatch theme font
+ </description>
+ </fontDefinition>
+</extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ locationURI="popup:#CompilationUnitEditorContext?after=group.show">
+ <command
+ commandId="org.eclipse.snipmatch.commands.search"
+ label="Search Snippets"
+ icon="images/flag.gif">
+ <visibleWhen>
+ <with
+ variable="activeEditorId">
+ <or>
+ <equals
+ value="org.eclipse.jdt.ui.CompilationUnitEditor">
+ </equals>
+ <equals
+ value="org.eclipse.jdt.ui.ClassFileEditor">
+ </equals>
+ </or>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
+</plugin>
diff --git a/plugins/org.eclipse.recommenders.snipmatch.rcp/src/org/eclipse/recommenders/snipmatch/rcp/CommandHandler.java b/plugins/org.eclipse.recommenders.snipmatch.rcp/src/org/eclipse/recommenders/snipmatch/rcp/CommandHandler.java
index 301a624..714438d 100755..100644
--- a/plugins/org.eclipse.recommenders.snipmatch.rcp/src/org/eclipse/recommenders/snipmatch/rcp/CommandHandler.java
+++ b/plugins/org.eclipse.recommenders.snipmatch.rcp/src/org/eclipse/recommenders/snipmatch/rcp/CommandHandler.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2011 Doug Wightman, Zi Ye
+ * Copyright (c) 2011 Doug Wightman, Zi Ye, Cheng Chen
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -22,23 +22,23 @@ public class CommandHandler extends AbstractHandler {
String id = event.getCommand().getId();
- if (id.equals("snipmatch.eclipse.commands.login")) {
+ if (id.equals("org.eclipse.snipmatch.commands.login")) {
SnipMatchPlugin.getDefault().showLoginBox(null, null);
}
- else if (id.equals("snipmatch.eclipse.commands.logout")) {
+ else if (id.equals("org.eclipse.snipmatch.commands.logout")) {
SnipMatchPlugin.getDefault().logout();
}
- else if (id.equals("snipmatch.eclipse.commands.search")) {
+ else if (id.equals("org.eclipse.snipmatch.commands.search")) {
SnipMatchPlugin.getDefault().showSearchBox("javasnippet");
}
- else if (id.equals("snipmatch.eclipse.commands.submit")) {
+ else if (id.equals("org.eclipse.snipmatch.commands.submit")) {
SnipMatchPlugin.getDefault().showSubmitBox();
}
- else if (id.equals("snipmatch.eclipse.commands.profile")) {
+ else if (id.equals("org.eclipse.snipmatch.commands.profile")) {
SnipMatchPlugin.getDefault().showProfileBox();
}