Permalink
Browse files

Merge pull request #47 from HiromuHota/fix/45

Make the perspective compatible with webSpoon (fix #45)
You are amazing Hota-san!
  • Loading branch information...
mattcasters committed Oct 3, 2018
2 parents 8917d9e + d9df8e9 commit 374960462f39fb1d8bf3cfb207168403e21f5262
@@ -53,6 +53,7 @@
import org.pentaho.ui.xul.dom.Document;
import org.pentaho.ui.xul.impl.AbstractXulEventHandler;
import org.pentaho.ui.xul.impl.XulEventHandler;
import org.pentaho.ui.xul.swt.tags.SwtDeck;
import org.pentaho.ui.xul.swt.tags.SwtTab;
import java.beans.PropertyChangeEvent;
@@ -88,17 +89,9 @@
protected MetaStoreFactory<NeoConnection> connectionFactory;
private static Neo4jPerspective instance;
private org.eclipse.swt.widgets.List wConnections;
public static Neo4jPerspective getInstance() throws XulException {
if ( instance == null ) {
instance = new Neo4jPerspective();
}
return instance;
}
private Neo4jPerspective() throws XulException {
Neo4jPerspective() throws XulException {
KettleXulLoader loader = new KettleXulLoader();
loader.registerClassLoader( getClass().getClassLoader() );
container = loader.loadXul( "neo4j_perspective.xul", resourceBundle );
@@ -115,6 +108,16 @@ private Neo4jPerspective() throws XulException {
addAdminTab();
/*
* To make compatible with webSpoon
* Create a temporary parent for the UI and then call layout().
* A different parent will be assigned to the UI in SpoonPerspectiveManager.PerspectiveManager.performInit().
*/
SwtDeck deck = (SwtDeck) Spoon.getInstance().getXulDomContainer().getDocumentRoot().getElementById( "canvas-deck" );
box = deck.createVBoxCard();
getUI().setParent( (Composite) box.getManagedObject() );
getUI().layout();
} catch ( Exception e ) {
logger.logError( "Error initializing perspective", e );
}
@@ -37,7 +37,7 @@
private Neo4jPerspective perspective;
public Neo4jSpoonPlugin() throws XulException {
this.perspective = Neo4jPerspective.getInstance();
this.perspective = new Neo4jPerspective();
}
@Override

0 comments on commit 3749604

Please sign in to comment.