Commit c28cab4e authored by Ubbo Veentjer's avatar Ubbo Veentjer
Browse files

remove view, as we have the editor now

parent 19c5a3d1
......@@ -38,7 +38,7 @@
</contentTypeContributor>
</extension>
<extension
<!--extension
point="org.eclipse.ui.views">
<category
name="BOL SammlungsDB"
......@@ -51,7 +51,7 @@
class="de.blumenbach_online.tglab.sammlungsdb.views.SammlungsDbView"
id="de.blumenbach_online.tglab.sammlungsdb.views.SammlungsDbView">
</view>
</extension>
</extension-->
<extension
point="org.eclipse.ui.editors">
......@@ -79,7 +79,7 @@
point="org.eclipse.ui.commands">
<command
description="Open BOL SammlungsDB Perspective"
id="de.blumenbach_online.tglab.sammlungsdb.showSadePublish"
id="de.blumenbach_online.tglab.sammlungsdb.showSammlungsDbPerspective"
name="BOL SammlungsDB">
</command>
</extension>
......@@ -87,22 +87,7 @@
point="org.eclipse.ui.handlers">
<handler
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="Open selected Object with BOL-DB"
id="de.blumenbach_online.tglab.sammlungsdb.publishSelected"
name="Open with BOL-DB">
</command>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
class="de.blumenbach_online.tglab.sammlungsdb.handlers.ShowSammlungsDbPerspectiveHandler"
commandId="de.blumenbach_online.tglab.sammlungsdb.publishSelected">
commandId="de.blumenbach_online.tglab.sammlungsdb.showSammlungsDbPerspective">
</handler>
</extension>
<extension
......@@ -110,39 +95,19 @@
<menuContribution
locationURI="menu:tools?after=tools.anchor1.3">
<command
commandId="de.blumenbach_online.tglab.sammlungsdb.showSadePublish"
commandId="de.blumenbach_online.tglab.sammlungsdb.showSammlungsDbPerspective"
icon="icons/Scull16x16.png">
</command>
</menuContribution>
<menuContribution
locationURI="toolbar:perspectivesbar">
<command
commandId="de.blumenbach_online.tglab.sammlungsdb.showSadePublish"
commandId="de.blumenbach_online.tglab.sammlungsdb.showSammlungsDbPerspective"
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/Scull16x16.png"
style="push">
<visibleWhen
checkEnabled="true">
<iterate>
<and>
<test
forcePluginActivation="true"
property="de.blumenbach_online.tglab.sammlungsdb.tester.IsSammlungsObject"
value="true">
</test>
</and>
</iterate>
</visibleWhen>
</command>
</menuContribution>
</extension>
<extension
point="org.eclipse.core.expressions.propertyTesters">
......@@ -154,18 +119,6 @@
type="java.lang.Object">
</propertyTester>
</extension>
<!--extension
point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension
targetID="org.eclipse.jdt.ui.JavaPerspective">
<view
ratio="0.5"
relative="org.eclipse.ui.views.TaskList"
relationship="right"
id="info.textgrid.lab.sadepublish.views.SammlungsDbView">
</view>
</perspectiveExtension>
</extension-->
<extension
point="org.eclipse.help.contexts">
<contexts
......
......@@ -39,7 +39,6 @@ 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.SammlungsDbView;
public class ShowSammlungsDbPerspectiveHandler extends AbstractHandler implements IHandler{
......@@ -61,7 +60,7 @@ public class ShowSammlungsDbPerspectiveHandler extends AbstractHandler implemen
wb.getIntroManager().closeIntro(wb.getIntroManager().getIntro());
// test if command was called from navigator
if(event.getCommand().getId().equals("de.blumenbach_online.tglab.sammlungsdb.publishSelected")) {
/*if(event.getCommand().getId().equals("de.blumenbach_online.tglab.sammlungsdb.publishSelected")) {
System.out.println("publish selected");
......@@ -84,7 +83,7 @@ public class ShowSammlungsDbPerspectiveHandler extends AbstractHandler implemen
}
}
}
}
}*/
} catch (WorkbenchException e) {
IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID,
......
/*
* #%L
* info.textgrid.lab.sadepublish
* %%
* Copyright (C) 2011 TextGrid Consortium (http://www.textgrid.de)
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L%
*/
package de.blumenbach_online.tglab.sammlungsdb.views;
import info.textgrid.lab.authn.RBACSession;
import org.eclipse.core.runtime.Platform;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTError;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.ProgressEvent;
import org.eclipse.swt.browser.ProgressListener;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;
import de.blumenbach_online.tglab.sammlungsdb.Activator;
import de.blumenbach_online.tglab.sammlungsdb.preferences.PluginPreferencePage;
public class SammlungsDbView extends ViewPart {
private Browser spBrowser;
private boolean browserReady = false;
public void createPartControl(Composite parent) {
try {
//spBrowser = new Browser(parent, SWT.MOZILLA);
spBrowser = new Browser(parent, SWT.NONE);
} catch (SWTError e) {
System.out.println("Could not instantiate Browserview " + e.getMessage());
return;
}
String url = Platform.getPreferencesService().getString(Activator.PLUGIN_ID, PluginPreferencePage.boldbUrl_id, "", null);
if(url.equals("")) {
spBrowser.setText("Keine SammlungsDB Adresse gesetzt, bitte setzen mit Fenster->Einstellungen->BOL SammlungsDB->...");
return;
}
spBrowser.setUrl(url);
spBrowser.addProgressListener(new ProgressListener() {
public void changed(ProgressEvent arg0) {}
public void completed(ProgressEvent arg0) {
String sid = RBACSession.getInstance().getSID(false);
//System.out.println("set sid to: " + sid);
spBrowser.execute("setSid('"+sid+"')");
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;
}
});
}
public void addTextGridObject(String uri, String title, String contentType) {
System.out.println("before browserready: u: " + uri + " - t: " + title + " - ct: " + contentType);
if(browserReady) {
System.out.println("u: " + uri + " - t: " + title + " - ct: " + contentType);
spBrowser.execute("addTGObject('"+uri+"', '"+title+"', '"+contentType+"')");
}
}
/**
* Passing the focus request to the viewer's control.
*/
public void setFocus() {
//viewer.getControl().setFocus();
}
}
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