Code Monkey home page Code Monkey logo

libreoffice-starter-extension's Introduction

LibreOffice Starter Extension

This repository contains some boilerplate code and config you need to get started to build your own LibreOffice Extension.

You can use this project as a starting point to write your own extension for LibreOffice.

Get started

  1. Install LibreOffice & the LibreOffice SDK (5.0 or greater)
  2. Install Eclipse IDE for Java Developers & the LOEclipse plugin
  3. Download this starter project & unzip it
  4. Import the project in Eclipse (File->Import->Existing Projects into Workspace)
  5. Let Eclipse know the paths to LibreOffice & the SDK (Project->Properties->LibreOffice Properties)
  6. Setup Run Configuration
    • Go to Run->Run Configurations
    • Create a new run configuration of the type "LibreOffice Application"
    • Select the project
    • Run!
    • Hint: Show the error log to view the output of the run configuration (Window->Show View->Error Log)
  7. The extension will be installed in LibreOffice (see Tools->Extension Manager)
  8. To launch the example dialog, click on the newly added toolbar/menu entry which have been added to Writer (named "Starter Project/Action One").

Development Hints

libreoffice-starter-extension's People

Contributors

smehrbrodt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

libreoffice-starter-extension's Issues

Problem adding accelerator

@smehrbrodt: Thanks for your great work. It runs without problems on my machine.
I used your code as template to add a toolbar for the project I worked on (LanguageTool). I also want to add an accelerator (short key) for a service of the project. The toolbar works fine. The accelerator gets LO (6.2.8) to crash without any exception thrown (running the same method as it was added to the toolbar).
The only thing I didn't install is the RegistrationHandler. Can this be the reason for the crash? I don't understand this part of code (the methods seems to be doubled (in StarterProjectImpl and RegistrationHandler)). Could you give me any help or a hint where I have to look?
Thanks a lot

Error while loading another XDL file

Sorry this does not strictly talk about this project.
The code for my extension is available here
The Test.xdl file works fine with this project i cloned,
The debugs shows the triggered function is called and the switch statements is working okay.

Also if i put a line like this,

    DialogHelper.showErrorMessage(m_xContext, null, "test : " + action);

before the Test object declation it shows
but if i put it after it do not shows, however it works well in this project cloned so my guess it was about consuming the context seems false?

I'm sorry for putting this there, but finding documentation and community for this kind of development in Java is like really difficult.

'Error running LibreOffice' and Workaround

Operating System: Fedora 34 (x86_64)
LibreOffice version: LibreOffice 7.1.5.2
Eclipse version: 2021-03 (4.19)
LOEclipse version: 4.0.1

When importing the unzipped libreoffice-starter-extension-master into Eclipse, two "No SDK or OOo set: won't build" items are listed in Eclipse's Problems tab, and the project in the Package Explorer is labelled with the red-box-with-white-x icon indicating an error. At the same time, the LibreOffice Properties section of the project's Properties dialog indicates that they're already set in accordance with the settings for LOEclipse; in my case, those settings are LibreOffice "LibreOffice 7.1" and SDK "7.1.4.2".

Running the project generates the error "Error running LibreOffice" in the Eclipse Error Log, and LibreOffice is not started. Interestingly, though, opening LO Writer finds that the extension is successfully installed.

This issue can be resolved by the minor workaround of going to Project->Properties->LibreOffice Properties as indicated in step 5 of "Get started" in README.md and, without changing any settings, clicking the "Apply and Close" button. As a result, the values "project.sdk" and "project.ooo" listed in libreoffice-starter-extension-master/.unoproject are updated to match those set in LibreOffice Properties, and the problems and error are resolved so LibreOffice starts as intended when the project is run.

There is no services.rdb file after running the project ?

As this link suggest
In order that UNO knows which implementation corresponds to which specification, the component will use registries. There are two of them: the first one describes all the component specifications (types.rdb) and the second translates the implementation into specifications (services.rdb) and is generated from the implementation.

Its showing only types.rdb file and giving error while opening it.
java.lang.NullPointerException at org.openoffice.ide.eclipse.core.editors.RegDocumentProvider.createDocument(RegDocumentProvider.java:98) at org.eclipse.ui.editors.text.FileDocumentProvider.createElementInfo(FileDocumentProvider.java:721) at org.eclipse.ui.texteditor.AbstractDocumentProvider.connect(AbstractDocumentProvider.java:392) at org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput(AbstractTextEditor.java:4178) at org.eclipse.ui.texteditor.StatusTextEditor.doSetInput(StatusTextEditor.java:229) at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.doSetInput(AbstractDecoratedTextEditor.java:1466) at org.eclipse.ui.editors.text.TextEditor.doSetInput(TextEditor.java:150) at org.eclipse.ui.texteditor.AbstractTextEditor$5.run(AbstractTextEditor.java:3154) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:437) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:353) at org.eclipse.ui.internal.WorkbenchWindow$14.run(WorkbenchWindow.java:2184) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70) at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2180) at org.eclipse.ui.texteditor.AbstractTextEditor.internalInit(AbstractTextEditor.java:3172) at org.eclipse.ui.texteditor.AbstractTextEditor.init(AbstractTextEditor.java:3197) at org.eclipse.ui.internal.EditorReference.initialize(EditorReference.java:362) at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:318) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

What does this extension do?

Its mentioned in read me file that extension will be installed in LibreOffice and you will see a toolbar and a menu entry have been added to Write. What does this extension do?

Cannot run starter extension on macOS

Thank you for providing this example. I followed the steps given, but whenever I run I get the following error:
sh: soffice.bin: command not found
However, I can run soffice directly from terminal.
How can I fix this error?

Can't include external jar

I'm not sure that it's an issue, but I don't know where to ask for help.

I have two problems that I can't explain, even using Eclipse debugger:
When a method from ActionOneDialog class calls an object from another package (in my case, a class from example.comp package), I get a noclassdeffounderror.

Same problem when a method calls an object from a jar library (I have put it manually in build directory, which I can see in jar file inside oxt after build step, and I declared it as an external jar in Eclipse's build path).

Do I need to declare every classes used by your classes ? If so, where ?
Do I need to declare every library used un my program ? If so, where in Eclipse?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.