Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#117 extract .common plugin with CommonDialogs and CommonConsole
- Loading branch information
Showing
20 changed files
with
244 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.nodeclipse.common</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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: Nodeclipse Common | ||
Bundle-SymbolicName: org.nodeclipse.common; singleton:=true | ||
Bundle-Version: 0.9.0.qualifier | ||
Bundle-Activator: org.nodeclipse.common.Activator | ||
Bundle-Vendor: Enide | ||
Require-Bundle: org.eclipse.ui, | ||
org.eclipse.core.runtime, | ||
org.eclipse.ui.ide, | ||
org.eclipse.ui.console | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 | ||
Bundle-ActivationPolicy: lazy | ||
Export-Package: org.nodeclipse.common.preferences, | ||
org.nodeclipse.common.ui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
Wow: Ctrl+V with some code in clipboard on java package will create new class and add that code into main() method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
source.. = src/ | ||
output.. = bin/ | ||
bin.includes = plugin.xml,\ | ||
META-INF/,\ | ||
.,\ | ||
icons/,\ | ||
help/,\ | ||
HelpToc.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?eclipse version="3.4"?> | ||
<plugin> | ||
|
||
</plugin> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" | ||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.nodeclipse.nodeclipse-1</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>0.9.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>org.nodeclipse.common</artifactId> | ||
<packaging>eclipse-plugin</packaging> | ||
|
||
<name>org.nodeclipse.common</name> | ||
<description>org.nodeclipse.common</description> | ||
</project> | ||
|
51 changes: 51 additions & 0 deletions
51
org.nodeclipse.common/src/org/nodeclipse/common/Activator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package org.nodeclipse.common; | ||
|
||
import org.eclipse.ui.plugin.AbstractUIPlugin; | ||
import org.nodeclipse.common.preferences.CommonConstants; | ||
import org.osgi.framework.BundleContext; | ||
|
||
/** | ||
* The activator class controls the plug-in life cycle | ||
*/ | ||
public class Activator extends AbstractUIPlugin { | ||
|
||
// The plug-in ID | ||
public static final String PLUGIN_ID = CommonConstants.PLUGIN_ID; | ||
|
||
// The shared instance | ||
private static Activator plugin; | ||
|
||
/** | ||
* The constructor | ||
*/ | ||
public Activator() { | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) | ||
*/ | ||
public void start(BundleContext context) throws Exception { | ||
super.start(context); | ||
plugin = this; | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) | ||
*/ | ||
public void stop(BundleContext context) throws Exception { | ||
plugin = null; | ||
super.stop(context); | ||
} | ||
|
||
/** | ||
* Returns the shared instance | ||
* | ||
* @return the shared instance | ||
*/ | ||
public static Activator getDefault() { | ||
return plugin; | ||
} | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
org.nodeclipse.common/src/org/nodeclipse/common/preferences/CommonConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.nodeclipse.common.preferences; | ||
|
||
public class CommonConstants { | ||
|
||
public static final String PLUGIN_ID = "org.nodeclipse.common"; //$NON-NLS-1$ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
org.nodeclipse.common/src/org/nodeclipse/common/ui/CommonConsole.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package org.nodeclipse.common.ui; | ||
|
||
import java.io.IOException; | ||
|
||
import org.eclipse.ui.console.ConsolePlugin; | ||
import org.eclipse.ui.console.IConsole; | ||
import org.eclipse.ui.console.IOConsoleOutputStream; | ||
import org.eclipse.ui.console.MessageConsole; | ||
|
||
/** | ||
* Console showing executable's options and launch parameters | ||
* and also runtime errors | ||
* | ||
* @author pverest | ||
*/ | ||
public class CommonConsole { | ||
|
||
private static CommonConsole instance = null; | ||
private static IOConsoleOutputStream stream = null; | ||
|
||
public CommonConsole() { | ||
MessageConsole console = new MessageConsole("Common Console", null); | ||
console.activate(); | ||
ConsolePlugin.getDefault().getConsoleManager() | ||
.addConsoles(new IConsole[] { console }); | ||
stream = console.newOutputStream(); | ||
} | ||
|
||
static { | ||
getInstance(); | ||
//write(VersionUtil.getLongString()); | ||
write("visit http://www.nodeclipse.org/\n\n"); | ||
} | ||
|
||
private static CommonConsole getInstance() { | ||
if (instance == null) | ||
instance = new CommonConsole(); | ||
return instance; | ||
} | ||
|
||
public static void write(String s) { | ||
// IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore(); | ||
// boolean nodeclipseConsoleEnabled = preferenceStore.getBoolean(PreferenceConstants.NODECLIPSE_CONSOLE_ENABLED);//@since 0.7 | ||
// if (!nodeclipseConsoleEnabled) | ||
// return; | ||
|
||
instance = getInstance(); | ||
try { | ||
stream.write(s); | ||
} catch (IOException e) { | ||
//TODO how to show? | ||
//e.printStackTrace(); | ||
} | ||
} | ||
|
||
@Override | ||
public void finalize() { | ||
try { | ||
stream.close(); | ||
} catch (IOException e) { | ||
//TODO how to show? | ||
//e.printStackTrace(); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.