Commit 8209c1b1 authored by Ubbo Veentjer's avatar Ubbo Veentjer
Browse files

further renaming, added icon, plugin starts working in lab

parent c561bb5b
http://www.softicons.com/holidays-icons/desktop-halloween-icons-by-aha-soft/scull-icon
......@@ -9,18 +9,18 @@
id="de.blumenbach_online.tglab.sammlungsdb">
</category>
<view
name="Sade Publish View"
icon="icons/153-Web-Preview.gif"
name="BOL SammlungsDB View"
icon="icons/Scull16x16.png"
category="de.blumenbach_online.tglab.sammlungsdb"
class="de.blumenbach_online.tglab.sammlungsdb.views.SadePublishView"
id="de.blumenbach_online.tglab.sammlungsdb.views.SadePublishView">
class="de.blumenbach_online.tglab.sammlungsdb.views.SammlungsDbView"
id="de.blumenbach_online.tglab.sammlungsdb.views.SammlungsDbView">
</view>
</extension>
<extension
point="org.eclipse.ui.perspectives">
<perspective
class="de.blumenbach_online.tglab.sammlungsdb.perspectives.SadePublishPerspective"
id="de.blumenbach_online.tglab.sammlungsdb.perspectives.SadePublishPerspective"
class="de.blumenbach_online.tglab.sammlungsdb.perspectives.SammlungsDbPerspective"
id="de.blumenbach_online.tglab.sammlungsdb.perspectives.SammlungsDbPerspective"
name="BOL SammlungsDB Perspective">
</perspective>
</extension>
......@@ -35,22 +35,22 @@
<extension
point="org.eclipse.ui.handlers">
<handler
class="de.blumenbach_online.tglab.sammlungsdb.handlers.ShowSadePublishPerspectiveHandler"
class="de.blumenbach_online.tglab.sammlungsdb.handlers.ShowSammlungsDbPerspectiveHandler"
commandId="de.blumenbach_online.tglab.sammlungsdb.showSadePublish">
</handler>
</extension>
<extension
point="org.eclipse.ui.commands">
<command
description="Publish selected Object to SADE"
description="Open selected Object with BOL-DB"
id="de.blumenbach_online.tglab.sammlungsdb.publishSelected"
name="Publish to SADE">
name="Open with BOL-DB">
</command>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
class="de.blumenbach_online.tglab.sammlungsdb.handlers.ShowSadePublishPerspectiveHandler"
class="de.blumenbach_online.tglab.sammlungsdb.handlers.ShowSammlungsDbPerspectiveHandler"
commandId="de.blumenbach_online.tglab.sammlungsdb.publishSelected">
</handler>
</extension>
......@@ -60,23 +60,23 @@
locationURI="menu:tools?after=tools.anchor1.3">
<command
commandId="de.blumenbach_online.tglab.sammlungsdb.showSadePublish"
icon="icons/153-Web-Preview.gif">
icon="icons/Scull16x16.png">
</command>
</menuContribution>
<menuContribution
locationURI="toolbar:perspectivesbar">
<command
commandId="de.blumenbach_online.tglab.sammlungsdb.showSadePublish"
icon="icons/153-Web-Preview.gif"
label="Sade Publish"
tooltip="Publish TextGrid Objects to Sade">
icon="icons/Scull16x16.png"
label="BOL-DB"
tooltip="Open Blumenbach SammlungsDB">
</command>
</menuContribution>
<menuContribution
locationURI="popup:org.eclipse.ui.popup.any?after=additions">
<command
commandId="de.blumenbach_online.tglab.sammlungsdb.publishSelected"
icon="icons/153-Web-Preview.gif"
icon="icons/Scull16x16.png"
style="push">
<visibleWhen
checkEnabled="true">
......@@ -84,7 +84,7 @@
<and>
<test
forcePluginActivation="true"
property="de.blumenbach_online.tglab.sammlungsdb.tester.IsPublishableObject"
property="de.blumenbach_online.tglab.sammlungsdb.tester.IsSammlungsObject"
value="true">
</test>
</and>
......@@ -96,10 +96,10 @@
<extension
point="org.eclipse.core.expressions.propertyTesters">
<propertyTester
class="de.blumenbach_online.tglab.sammlungsdb.tester.IsPublishableObject"
id="de.blumenbach_online.tglab.sammlungsdb.tester.IsPublishableObject"
class="de.blumenbach_online.tglab.sammlungsdb.tester.IsSammlungsObject"
id="de.blumenbach_online.tglab.sammlungsdb.tester.IsSammlungsObject"
namespace="ide.blumenbach_online.tglab.sammlungsdb.tester"
properties="IsPublishableObject"
properties="IsSammlungsObject"
type="java.lang.Object">
</propertyTester>
</extension>
......@@ -111,7 +111,7 @@
ratio="0.5"
relative="org.eclipse.ui.views.TaskList"
relationship="right"
id="info.textgrid.lab.sadepublish.views.SadePublishView">
id="info.textgrid.lab.sadepublish.views.SammlungsDbView">
</view>
</perspectiveExtension>
</extension-->
......@@ -126,7 +126,7 @@
<page
class="de.blumenbach_online.tglab.sammlungsdb.preferences.PluginPreferencePage"
id="de.blumenbach_online.tglab.sammlungsdb.preferences"
name="Sade Publisher">
name="BOL Sammlungs DB">
</page>
</extension>
......
......@@ -36,7 +36,7 @@ import org.osgi.framework.BundleContext;
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "info.textgrid.lab.sadepublish"; //$NON-NLS-1$
public static final String PLUGIN_ID = "de.blumenbach_online.tglab.sammlungsdb"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
......
......@@ -39,9 +39,9 @@ import org.eclipse.ui.WorkbenchException;
import org.eclipse.ui.handlers.HandlerUtil;
import de.blumenbach_online.tglab.sammlungsdb.Activator;
import de.blumenbach_online.tglab.sammlungsdb.views.SadePublishView;
import de.blumenbach_online.tglab.sammlungsdb.views.SammlungsDbView;
public class ShowSadePublishPerspectiveHandler extends AbstractHandler implements IHandler{
public class ShowSammlungsDbPerspectiveHandler extends AbstractHandler implements IHandler{
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
......@@ -51,17 +51,17 @@ public class ShowSadePublishPerspectiveHandler extends AbstractHandler implemen
IWorkbench wb = PlatformUI.getWorkbench();
wb.getActiveWorkbenchWindow().getActivePage().setPerspective(
wb.getPerspectiveRegistry().findPerspectiveWithId(
"info.textgrid.lab.sadepublish.perspectives.SadePublishPerspective"));
"de.blumenbach_online.tglab.sammlungsdb.perspectives.SammlungsDbPerspective"));
wb.getActiveWorkbenchWindow().getActivePage().resetPerspective();
// show it when necessary
PlatformUI.getWorkbench().showPerspective(
"info.textgrid.lab.sadepublish.perspectives.SadePublishPerspective",
"de.blumenbach_online.tglab.sammlungsdb.perspectives.SammlungsDbPerspective",
PlatformUI.getWorkbench().getActiveWorkbenchWindow());
wb.getIntroManager().closeIntro(wb.getIntroManager().getIntro());
// test if command was called from navigator
if(event.getCommand().getId().equals("info.textgrid.lab.sadepublish.publishSelected")) {
if(event.getCommand().getId().equals("de.blumenbach_online.tglab.sammlungsdb.publishSelected")) {
System.out.println("publish selected");
......@@ -78,8 +78,8 @@ public class ShowSadePublishPerspectiveHandler extends AbstractHandler implemen
String uri = tgo.getURI().toString();
String contentType = tgo.getMetadata().getGeneric().getProvided().getFormat();
((SadePublishView)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.findView("info.textgrid.lab.sadepublish.views.SadePublishView")).addTextGridObject(uri, title, contentType);
((SammlungsDbView)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.findView("de.blumenbach_online.tglab.sammlungsdb.views.SammlungsDbView")).addTextGridObject(uri, title, contentType);
}
}
......@@ -88,7 +88,7 @@ public class ShowSadePublishPerspectiveHandler extends AbstractHandler implemen
} catch (WorkbenchException e) {
IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID,
"Could not open Sade Publisher Perspective!", e);
"Could not open SammlungsDB Perspective!", e);
Activator.getDefault().getLog().log(status);
} catch (CoreException e) {
IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID,
......
......@@ -25,7 +25,7 @@ import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;
public class SadePublishPerspective implements IPerspectiveFactory{
public class SammlungsDbPerspective implements IPerspectiveFactory{
@Override
public void createInitialLayout(IPageLayout layout) {
......@@ -39,7 +39,7 @@ public class SadePublishPerspective implements IPerspectiveFactory{
IFolderLayout topRight=
layout.createFolder("topRight", IPageLayout.RIGHT, (float)0.4, editorArea);//$NON-NLS-1$
topRight.addView("info.textgrid.lab.sadepublish.views.SadePublishView");
topRight.addView("de.blumenbach_online.tglab.sammlungsdb.views.SammlungsDbView");
layout.setEditorAreaVisible(false);
}
......
......@@ -30,16 +30,16 @@ import de.blumenbach_online.tglab.sammlungsdb.Activator;
public class PluginPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage{
public static String sadeUrl_id = "sade_instance_url";
public static String sadeUser_id = "sade_instance_user";
public static String sadePW_id = "sade_instance_pw";
public static String boldbUrl_id = "boldb_url";
public static String boldbUser_id = "boldb_user";
public static String boldbPW_id = "boldb_pw";
@Override
protected void createFieldEditors() {
addField(new StringFieldEditor(sadeUrl_id, "URL for SADE instance", getFieldEditorParent()));
addField(new StringFieldEditor(sadeUser_id, "Authorized user", getFieldEditorParent()));
addField(new StringFieldEditor(sadePW_id, "Password", getFieldEditorParent()));
addField(new StringFieldEditor(boldbUrl_id, "URL to SammlungsDB", getFieldEditorParent()));
addField(new StringFieldEditor(boldbUser_id, "Authorized user", getFieldEditorParent()));
addField(new StringFieldEditor(boldbPW_id, "Password", getFieldEditorParent()));
}
......
......@@ -32,7 +32,7 @@ public class PluginPreferencePageInitializer extends AbstractPreferenceInitializ
public void initializeDefaultPreferences() {
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
store.setDefault(PluginPreferencePage.sadeUrl_id, "http://localhost:8080/tgwp/dnd.html");
store.setDefault(PluginPreferencePage.boldbUrl_id, "http://localhost:8080/");
}
......
......@@ -7,7 +7,7 @@ import info.textgrid.lab.core.swtutils.AdapterUtils;
import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.core.runtime.CoreException;
public class IsPublishableObject extends PropertyTester {
public class IsSammlungsObject extends PropertyTester {
@Override
public boolean test(Object receiver, String property, Object[] args,
......
......@@ -37,7 +37,7 @@ import de.blumenbach_online.tglab.sammlungsdb.Activator;
import de.blumenbach_online.tglab.sammlungsdb.preferences.PluginPreferencePage;
public class SadePublishView extends ViewPart {
public class SammlungsDbView extends ViewPart {
private Browser spBrowser;
private boolean browserReady = false;
......@@ -52,7 +52,7 @@ public class SadePublishView extends ViewPart {
return;
}
String url = Platform.getPreferencesService().getString(Activator.PLUGIN_ID, PluginPreferencePage.sadeUrl_id, "", null);
String url = Platform.getPreferencesService().getString(Activator.PLUGIN_ID, PluginPreferencePage.boldbUrl_id, "", null);
if(url.equals("")) {
spBrowser.setText("No publish destination, please set one with Window->Preferences->Sade Publisher");
......@@ -68,8 +68,8 @@ public class SadePublishView extends ViewPart {
//System.out.println("set sid to: " + sid);
spBrowser.execute("setSid('"+sid+"')");
String user = Platform.getPreferencesService().getString(Activator.PLUGIN_ID, PluginPreferencePage.sadeUser_id, "", null);
String pw = Platform.getPreferencesService().getString(Activator.PLUGIN_ID, PluginPreferencePage.sadePW_id, "", null);
String user = Platform.getPreferencesService().getString(Activator.PLUGIN_ID, PluginPreferencePage.boldbUser_id, "", null);
String pw = Platform.getPreferencesService().getString(Activator.PLUGIN_ID, PluginPreferencePage.boldbPW_id, "", null);
spBrowser.execute("setAuth('"+user+"','"+pw+"')");
browserReady = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment