Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #52 Creation of Menu solving Ant export should be a separate export #66

Merged
merged 11 commits into from
Mar 26, 2018

Conversation

shobhanmandal
Copy link
Contributor

A new Wizard Menu under LibreOffice is now shown which allows you to create the ANT file build.xml in one go rather than going for Package Export followed by the ANT file generation.

@smehrbrodt
Copy link
Contributor

When I select the new option in the export dialog, I get:
The selected wizard could not be started. Plug-in org.libreoffice.ide.eclipse.core was unable to load class org.libreoffice.ide.eclipse.core.wizards.AntScriptWizard. org.libreoffice.ide.eclipse.core.wizards.AntScriptWizard cannot be found by org.libreoffice.ide.eclipse.core_2.2.6

@smehrbrodt
Copy link
Contributor

Ok the problem was on my side, the new java files were not compiled somehow.

This works basically :)

Some points:

  • Please remove the ant export option from the original export wizard
  • The whole ant export should be in the "java" package, not in "core". Everything in core should not be language dependant. We want to have python support for example at some stage. There we don't need ant export.

Also please have a look at your coding style. There was some incorrect indentation and some excessive blank lines. You might consider using Eclipse's source format feature.

* @param pAntScriptPage
* Helps in retrieving the project selected in this part.
*/
public static void setAntScriptExportPage(AntScriptExportWizardPage pAntScriptPage) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please no references to the ant stuff from here. If you need a shared method, add it to some helper class or something.

@@ -0,0 +1 @@
/UnoPackageExportPage.java
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this file got created and pushed, would remove it

@@ -145,7 +145,7 @@ private void loadData() {
i++;
}

if(selected) {
if (selected) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this whole file still needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this file forms the first page of the Export -> 'LibreOffice Package', the Ant Script gets build from the 'ManifestExportPage' which is the second page in the export. Nothing related to Ant Script building was form the first page, so has to be kept intact, second page 'ManifestExportPage' though had a number of changes.

@@ -14,6 +14,7 @@ wizards.service = UNO service
wizards.interface = UNO interface
wizards.export = LibreOffice package


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please no whitespace / new line changes in existing files.

@@ -78,4 +78,5 @@ public void setPage(ManifestExportPage pPage) {
protected ManifestExportPage getPage() {
return mPage;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

setControl(body);

createProjectSelection();
sContentSelector = new PackageContentSelector(body, SWT.NONE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need the PackageContentSelector on this wizard. It's not used in the ant export.

}
}

File tmpDir = new File(directory + "/build.xml");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please chose a better name than tmpDir, maybe antFile?

if (mController.getSaveAntScript()) {

String directory = mAntScriptPage.getPath();
File tmpDir = new File(directory + "/build.xml");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please chose a better name than tmpDir, maybe antFile?

*/
public class AntScriptExportWizard extends Wizard implements IExportWizard {

private static final String DIALOG_SETTINGS_KEY = "oxt.export"; //$NON-NLS-1$
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please chose a different key here. this one is used for the package export.

@@ -118,7 +116,7 @@ public ManifestExportPage(String pPageName, IUnoidlProject pProject) {
*/
public void setProject(IUnoidlProject pProject) {
mProject = pProject;
reloadLanguagePart();
// reloadLanguagePart();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still needed? If not please remove.

@@ -66,9 +63,20 @@
private Button mSaveScripts;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This button seems unused?

public class AntScriptExportWizardPage extends WizardPage {

private IUnoidlProject sSelectedProject;
private LanguageExportPart sLangPart;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm this LanguageExportPart was designed to add some language specific options to the package export wizard.
It seems a bit weird that we have a LangaugeExportPart on a java specific AntScriptWizardPage.
Maybe you can rename it so it matches better what it's actually used for now? Also I don't know if we still need to derive from the LanguageExportPart, or we just make it an own class?
Maybe also just include the relevant stuff directly here without this extra class?

Not sure what is best, but this looks cumbersome at least.

@smehrbrodt smehrbrodt merged commit 7842ff7 into LibreOffice:master Mar 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants