mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-08-08 22:25:31 +00:00
Slow progress getting packer to run as a plugin.
This commit is contained in:
@@ -150,6 +150,14 @@ public class Application extends javafx.application.Application implements Appli
|
||||
+ "org.badvision.outlaweditor.data.xml,"
|
||||
+ "org.badvision.outlaweditor.ui,"
|
||||
+ "org.osgi.framework");
|
||||
// MH: Had to add these to allow plugin to access basic Java XML classes,
|
||||
// and other stuff you'd think would just be default.
|
||||
config.put("org.osgi.framework.bootdelegation",
|
||||
"sun.*,"
|
||||
+ "com.sun.*,"
|
||||
+ "org.w3c.*,"
|
||||
+ "org.xml.*,"
|
||||
+ "javax.xml.*");
|
||||
felix = new Felix(config);
|
||||
felix.start();
|
||||
felix.getBundleContext().registerService(ApplicationState.class, this, null);
|
||||
|
@@ -15,7 +15,7 @@ import org.badvision.outlaweditor.api.ApplicationState;
|
||||
import org.badvision.outlaweditor.api.MenuAction;
|
||||
import org.badvision.outlaweditor.ui.UIAction;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
/**
|
||||
* This registers a plugin which creates Apple II disk images.
|
||||
@@ -33,14 +33,14 @@ public class A2PackPlugin implements MenuAction {
|
||||
// This is called when our plugin is starting
|
||||
@Activate
|
||||
public void activate() throws Exception {
|
||||
System.out.println("Hello, menu 3!");
|
||||
checkReferences();
|
||||
//System.out.println("Hello, menu!");
|
||||
System.out.println(Element.ATTRIBUTE_NODE);
|
||||
}
|
||||
|
||||
// This is called when our plugin is stopping
|
||||
@Deactivate
|
||||
public void stop(BundleContext bc) throws Exception {
|
||||
System.out.println("Goodbye, menu!");
|
||||
//System.out.println("Goodbye, menu!");
|
||||
}
|
||||
|
||||
// This identifies the menu item label
|
||||
@@ -49,10 +49,14 @@ public class A2PackPlugin implements MenuAction {
|
||||
return "Build Apple II disk";
|
||||
}
|
||||
|
||||
public void callback(String event)
|
||||
public void error(String msg, String context)
|
||||
{
|
||||
System.out.println("Hello from callback.");
|
||||
System.out.println("Event is: " + event);
|
||||
System.out.println("Error: msg=" + msg + ", context=" + context);
|
||||
}
|
||||
|
||||
public void warnings(int nWarnings, String str)
|
||||
{
|
||||
System.out.println("Warnings: nWarnings=" + nWarnings + ", str=" + str);
|
||||
}
|
||||
|
||||
// This method is called when the user selects the menu item
|
||||
@@ -77,17 +81,4 @@ public class A2PackPlugin implements MenuAction {
|
||||
}
|
||||
UIAction.alert("A2_4evr!");
|
||||
}
|
||||
|
||||
private void checkReferences() {
|
||||
// app = ApplicationState.getInstance();
|
||||
if (app == null) {
|
||||
System.out.println("App is null?!?!");
|
||||
} else {
|
||||
if (app.getCurrentPlatform() == null) {
|
||||
System.out.println("Current platform is null?");
|
||||
} else {
|
||||
System.out.println("Current platform is "+app.getCurrentPlatform());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1456,9 +1456,10 @@ class A2PackPartitions
|
||||
if (!res)
|
||||
res = getClass().getResource("/" + partial.replace("\\", "/"))
|
||||
if (res) {
|
||||
def m = res.toString() =~ /^jar:file:(.*)!.*$/
|
||||
def m = res.toString() =~ /^(jar:file:|bundle:\/\/[^\/]*)(.*)!.*$/
|
||||
println res.toString()
|
||||
assert m
|
||||
srcFile = new File(java.net.URLDecoder.decode(m.group(1), "UTF-8"))
|
||||
srcFile = new File(java.net.URLDecoder.decode(m.group(2), "UTF-8"))
|
||||
if (dstFile.exists()) {
|
||||
if (srcFile.lastModified() <= dstFile.lastModified())
|
||||
return dstFile
|
||||
|
Reference in New Issue
Block a user