# HG changeset patch # User dwinter # Date 1308236004 -7200 # Node ID 6c0a97ea21c72107a104dbe0ad8302f94ab4b932 first release diff -r 000000000000 -r 6c0a97ea21c7 .classpath --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.classpath Thu Jun 16 16:53:24 2011 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -r 000000000000 -r 6c0a97ea21c7 .project --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.project Thu Jun 16 16:53:24 2011 +0200 @@ -0,0 +1,28 @@ + + + de.mpg.mpiwg.itgroup.textgrid.digilib + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff -r 000000000000 -r 6c0a97ea21c7 .settings/org.eclipse.jdt.core.prefs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.settings/org.eclipse.jdt.core.prefs Thu Jun 16 16:53:24 2011 +0200 @@ -0,0 +1,8 @@ +#Wed Dec 29 17:55:05 CET 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +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 diff -r 000000000000 -r 6c0a97ea21c7 META-INF/MANIFEST.MF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/META-INF/MANIFEST.MF Thu Jun 16 16:53:24 2011 +0200 @@ -0,0 +1,18 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Digilib +Bundle-SymbolicName: de.mpg.mpiwg.itgroup.textgrid.digilib;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: de.mpg.mpiwg.itgroup.textgrid.digilib.Activator +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + de.mpg.mpiwg.itgroup.digilib.plugin;bundle-version="0.0.1", + org.eclipse.ui.editors, + org.eclipse.ui.views;bundle-version="3.5.0", + org.eclipse.ui.ide, + org.eclipse.core.resources;bundle-version="3.6.0", + info.textgrid.lab.core.swtutils;bundle-version="1.0.2", + org.eclipse.ui.views.properties.tabbed;bundle-version="3.5.100", + info.textgrid.lab.core.model;bundle-version="0.0.2" +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff -r 000000000000 -r 6c0a97ea21c7 build.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build.properties Thu Jun 16 16:53:24 2011 +0200 @@ -0,0 +1,5 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml diff -r 000000000000 -r 6c0a97ea21c7 plugin.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugin.xml Thu Jun 16 16:53:24 2011 +0200 @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r 6c0a97ea21c7 src/de/mpg/mpiwg/itgroup/textgrid/digilib/Activator.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/de/mpg/mpiwg/itgroup/textgrid/digilib/Activator.java Thu Jun 16 16:53:24 2011 +0200 @@ -0,0 +1,50 @@ +package de.mpg.mpiwg.itgroup.textgrid.digilib; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +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 = "de.mpg.mpiwg.itgroup.textgrid.digilib"; //$NON-NLS-1$ + + // 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; + } + +} diff -r 000000000000 -r 6c0a97ea21c7 src/de/mpg/mpiwg/itgroup/textgrid/digilib/DigilibHandler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/de/mpg/mpiwg/itgroup/textgrid/digilib/DigilibHandler.java Thu Jun 16 16:53:24 2011 +0200 @@ -0,0 +1,74 @@ +package de.mpg.mpiwg.itgroup.textgrid.digilib; + +import java.net.URI; + +import info.textgrid.lab.authn.RBACSession; +import info.textgrid.lab.core.model.TextGridObject; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.IHandler; +import org.eclipse.core.commands.IHandlerListener; +import org.eclipse.core.resources.IFile; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.handlers.HandlerUtil; +import info.textgrid.lab.core.swtutils.AdapterUtils; + +import de.mpg.mpiwg.itgroup.digilib.plugin.editors.DigilibLinkEditorInput; +import de.mpg.mpiwg.itgroup.digilib.plugin.editors.DigilibLinkEditorPart; + + +public class DigilibHandler implements IHandler { + + public void addHandlerListener(IHandlerListener handlerListener) { + // TODO Auto-generated method stub + + } + + public void dispose() { + // TODO Auto-generated method stub + + } + + public Object execute(ExecutionEvent event) throws ExecutionException { + + ISelection currentSelection = HandlerUtil.getCurrentSelection(event); + if (IStructuredSelection.class.isInstance(currentSelection)) { + IStructuredSelection selection = (IStructuredSelection) currentSelection; + TextGridObject object = AdapterUtils.getAdapter(selection.getFirstElement(), TextGridObject.class); + + + IFile file = (IFile) object.getAdapter(IFile.class); + URI textGridUri = object.getURI(); + String sid = RBACSession.getInstance().getSID(true); + DigilibLinkEditorInput input = new DigilibLinkEditorInput(textGridUri,sid,DigilibLinkEditorInput.TEXTGRID); + + try { + DigilibLinkEditorPart dp = (DigilibLinkEditorPart) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().openEditor(input,"de.mpg.mpiwg.itgroup.digilib.plugin.digilibLinkEditor"); + return dp; + } catch (PartInitException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + return null; + } + + public boolean isEnabled() { + + return true; + } + + public boolean isHandled() { + // TODO Auto-generated method stub + return false; + } + + public void removeHandlerListener(IHandlerListener handlerListener) { + // TODO Auto-generated method stub + + } + +}