Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Initial checkin
  • Loading branch information
j0hnds committed Sep 5, 2008
0 parents commit cbcc847
Show file tree
Hide file tree
Showing 11 changed files with 595 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .classpath
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/jdom.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
*~
bin/*
28 changes: 28 additions & 0 deletions .project
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.hephaestus.utils</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>
7 changes: 7 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
#Fri Sep 05 14:16:20 MDT 2008
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.5
18 changes: 18 additions & 0 deletions META-INF/MANIFEST.MF
@@ -0,0 +1,18 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Utils Plug-in
Bundle-SymbolicName: com.hephaestus.utils
Bundle-Version: 1.0.0
Bundle-Vendor: Hephaestus
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: lib/jdom.jar,
.
Export-Package: com.hephaestus.util,
org.jdom,
org.jdom.adapters,
org.jdom.filter,
org.jdom.input,
org.jdom.output,
org.jdom.transform,
org.jdom.xpath
Require-Bundle: org.eclipse.ui;bundle-version="3.4.0"
5 changes: 5 additions & 0 deletions build.properties
@@ -0,0 +1,5 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
lib/jdom.jar
Binary file added lib/jdom.jar
Binary file not shown.
40 changes: 40 additions & 0 deletions src/com/hephaestus/util/ClipboardUtil.java
@@ -0,0 +1,40 @@
package com.hephaestus.util;

import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.widgets.Display;

/**
* A utility class used by the plugin to access various functionality.
*
* @author Dave Sieh
*
*/
public class ClipboardUtil {
// Reference to the clipboard
private static Clipboard clipboard;

/**
* Retrieves a reference to the clipboard.
*
* @return reference to the clipboard.
*/
public static Clipboard getClipboard() {
if (clipboard == null) {
clipboard = new Clipboard(Display.getCurrent());
}

return clipboard;
}

/**
* Disposes of the system resources allocated with the
* clipboard.
*/
public static void disposeClipboard() {
if (clipboard != null) {
clipboard.dispose();
clipboard = null;
}
}

}

0 comments on commit cbcc847

Please sign in to comment.