Working
This commit is contained in:
parent
2a95bff6fc
commit
5eb08eded3
5 changed files with 46 additions and 58 deletions
|
@ -29,11 +29,11 @@ dependencies{
|
|||
bundledLibs 'org.libreoffice:unoil:5.3.2'
|
||||
bundledLibs 'org.json:json:20190722'
|
||||
compile 'junit:junit:4.12'
|
||||
bundledLibs group: 'com.miglayout', name: 'miglayout-swing', version: '5.2'
|
||||
bundledLibs group: 'org.apache.jena', name: 'jena-core', version: '3.15.0'
|
||||
bundledLibs group: 'org.apache.jena', name: 'jena-arq', version: '3.15.0'
|
||||
bundledLibs group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.30'
|
||||
bundledLibs group: 'com.opencsv', name: 'opencsv', version: '5.1'
|
||||
bundledLibs group: 'com.miglayout', name: 'miglayout-swing', version: '5.2'
|
||||
bundledLibs files('idl')
|
||||
configurations.compile.extendsFrom(configurations.bundledLibs)
|
||||
}
|
||||
|
@ -85,6 +85,7 @@ task xhtml(type: Jar) {
|
|||
include 'w2phtml/xhtml/**/**/*.properties'
|
||||
from sourceSets.main.output
|
||||
include 'org/**/*'
|
||||
include 'net/**/*'
|
||||
}
|
||||
|
||||
task xhtml2(type: Jar) {
|
||||
|
@ -104,14 +105,13 @@ task xhtml2(type: Jar) {
|
|||
exclude '**/*Test.class'
|
||||
exclude '**/AllTests.class'
|
||||
exclude '**/*.java'
|
||||
include 'org/openoffice/da/comp/wl2common/**/*.class'
|
||||
include 'org/openoffice/da/comp/writer2xhtml/**/*.class'
|
||||
include 'org/openoffice/da/comp/wl2common/**/*.properties'
|
||||
include 'w2phtml/pageSplitters/**/*.class'
|
||||
include 'pro/litvinovg/**/*.class'
|
||||
include 'pro/litvinovg/**/*.png'
|
||||
include 'pro/litvinovg/**/*.classes'
|
||||
include 'w2phtml/api/**/*.class'
|
||||
include 'w2phtml/base/**/*.class'
|
||||
include 'w2phtml/rdf/**/*.class'
|
||||
include 'w2phtml/epub/**/*.class'
|
||||
include 'w2phtml/office/**/*.class'
|
||||
include 'w2phtml/util/**/*.class'
|
||||
|
@ -123,6 +123,7 @@ task xhtml2(type: Jar) {
|
|||
include 'w2phtml/xhtml/**/**/*.properties'
|
||||
from sourceSets.main.output
|
||||
include 'org/**/*'
|
||||
include 'net/**/*'
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
package pro.litvinovg.w2phtml;
|
||||
|
||||
|
||||
|
||||
import com.sun.star.awt.XDialog;
|
||||
import com.sun.star.awt.XDialogEventHandler;
|
||||
import com.sun.star.lang.WrappedTargetException;
|
||||
import com.sun.star.uno.XComponentContext;
|
||||
|
||||
|
||||
public class ActionOneDialog implements XDialogEventHandler {
|
||||
|
||||
private XDialog dialog;
|
||||
private static final String actionOk = "actionOk";
|
||||
private String[] supportedActions = new String[] { actionOk };
|
||||
|
||||
public ActionOneDialog(XComponentContext xContext) {
|
||||
this.dialog = DialogHelper.createDialog("ActionOneDialog.xdl", xContext, this);
|
||||
}
|
||||
|
||||
public void show() {
|
||||
dialog.execute();
|
||||
}
|
||||
|
||||
private void onOkButtonPressed() {
|
||||
dialog.endExecute();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean callHandlerMethod(XDialog dialog, Object eventObject, String methodName) throws WrappedTargetException {
|
||||
if (methodName.equals(actionOk)) {
|
||||
onOkButtonPressed();
|
||||
return true; // Event was handled
|
||||
}
|
||||
return false; // Event was not handled
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getSupportedMethodNames() {
|
||||
return supportedActions;
|
||||
}
|
||||
|
||||
}
|
|
@ -10,6 +10,8 @@ import com.sun.star.lib.uno.helper.Factory;
|
|||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
|
||||
import javax.swing.UnsupportedLookAndFeelException;
|
||||
|
||||
import com.sun.star.beans.Property;
|
||||
import com.sun.star.beans.XPropertyContainer;
|
||||
import com.sun.star.beans.XPropertySet;
|
||||
|
@ -82,7 +84,12 @@ public final class W2PHTMLExtension extends WeakBase
|
|||
{
|
||||
switch (action) {
|
||||
case "openGUI":
|
||||
ConfigurationWindow.runGUI();
|
||||
try {
|
||||
ConfigurationWindow.runGUI(context);
|
||||
} catch(Throwable e) {
|
||||
DialogHelper.showErrorMessage(context, null, e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
break;
|
||||
//case "actionOne":
|
||||
// ActionOneDialog actionOneDialog = new ActionOneDialog(context);
|
||||
|
|
|
@ -4,6 +4,11 @@ import java.awt.EventQueue;
|
|||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.UIManager;
|
||||
|
||||
import com.sun.star.uno.XComponentContext;
|
||||
|
||||
import pro.litvinovg.w2phtml.DialogHelper;
|
||||
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.GridLayout;
|
||||
import javax.swing.JTabbedPane;
|
||||
|
@ -13,6 +18,10 @@ import javax.swing.JPanel;
|
|||
|
||||
public class ConfigurationWindow extends JFrame {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static JFrame singleFrame = null;
|
||||
|
||||
|
||||
|
@ -20,7 +29,7 @@ public class ConfigurationWindow extends JFrame {
|
|||
* Launch the application.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
runGUI();
|
||||
runGUI(null);
|
||||
/*
|
||||
* EventQueue.invokeLater(new Runnable() { public void run() { try {
|
||||
* ConfigurationWindow window = new ConfigurationWindow();
|
||||
|
@ -29,6 +38,8 @@ public class ConfigurationWindow extends JFrame {
|
|||
*/
|
||||
}
|
||||
|
||||
private XComponentContext context;
|
||||
|
||||
/**
|
||||
* Create the application.
|
||||
*/
|
||||
|
@ -40,6 +51,15 @@ public class ConfigurationWindow extends JFrame {
|
|||
createEvents();
|
||||
}
|
||||
|
||||
public ConfigurationWindow(XComponentContext context) {
|
||||
this.context = context;
|
||||
setTitle("Converter from ODT to HTML, ePub and RDF");
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
setIconImage(Toolkit.getDefaultToolkit().getImage(ConfigurationWindow.class.getResource("/pro/litvinovg/w2phtml/gui/resources/w2phtml.png")));
|
||||
initComponents();
|
||||
createEvents();
|
||||
}
|
||||
|
||||
private void createEvents() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
@ -67,25 +87,28 @@ public class ConfigurationWindow extends JFrame {
|
|||
menuBar.add(mnFile);
|
||||
}
|
||||
|
||||
public static void runGUI() {
|
||||
public static void runGUI(XComponentContext context) {
|
||||
|
||||
if (singleFrame != null) {
|
||||
singleFrame.dispose();
|
||||
}
|
||||
try {
|
||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||
} catch (Throwable e) {
|
||||
DialogHelper.showErrorMessage(context, null, e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
EventQueue.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
ConfigurationWindow frame = new ConfigurationWindow();
|
||||
ConfigurationWindow frame = new ConfigurationWindow(context);
|
||||
singleFrame = frame;
|
||||
frame.setBounds(100, 100, 800, 800);
|
||||
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
||||
frame.setVisible(true);
|
||||
|
||||
} catch (Exception e) {
|
||||
} catch (Throwable e) {
|
||||
DialogHelper.showErrorMessage(context, null, e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue