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
Add Support for Python in LOEclipse Plugin (GSoC - 18) #68
Changes from 12 commits
da7a6e1
7562fb0
7438021
d47c78c
fbd5b5a
a707569
d01603d
080a6b6
b14f0e5
37cd0ed
68e8f8a
d58ea7a
111c7cf
bc8132d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bin.includes = feature.xml |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -196,14 +196,16 @@ public static IUnoidlProject createStructure(UnoFactoryData pData, IProgressMoni | |
// Save all the properties to the configuration file | ||
unoProject.saveAllProperties(); | ||
|
||
// Creation of the unoidl package | ||
createUnoidlPackage(unoProject, pMonitor); | ||
if (!language.getName().contains("Python")) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be language independent. IDL files can be used in all languages. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://drive.google.com/drive/folders/1DvyqQIn5WEE7MjcWXIo76UdPk35YcEB_ createCodePackage(unoProject, pMonitor); -> This makes the LibreOffice 5.1 libraries visible again, do refer to the Images(Page-4) and if the Source folder does not exist it creates it createUrdDir(unoProject, pMonitor); -> This creates the build folder under the Project Folder and also places a urd folder under the build Folder I am sure that last two functions will not be required for the Python module, and as for createUnoidlPackage(unoProject, pMonitor) I will look into it. |
||
// Creation of the unoidl package | ||
createUnoidlPackage(unoProject, pMonitor); | ||
|
||
// Creation of the Code Packages | ||
createCodePackage(unoProject, pMonitor); | ||
// Creation of the Code Packages | ||
createCodePackage(unoProject, pMonitor); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order was restored since the source folder was created inside configureProject(UnoFactoryData pData, IProgressMonitor pMonitor) |
||
// Creation of the urd output directory | ||
createUrdDir(unoProject, pMonitor); | ||
// Creation of the urd output directory | ||
createUrdDir(unoProject, pMonitor); | ||
} | ||
|
||
return unoProject; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -309,7 +309,7 @@ public IWorkbench getWorkbench() { | |
private void updateLoanguagePage() { | ||
// Create/Remove the language page if needed | ||
AbstractLanguage lang = mMainPage.getChosenLanguage(); | ||
if (lang != null) { | ||
if (lang != null && !lang.toString().contains("python")) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should also be language independent There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This refers to the checkbox on second page of the New Project Wizard page is to include the testclasses, which are yet to be developed for Python therefore we will not allow that particular page to show up in the New Project Wizard. I believe if condition is required to stop the page from getting in the sequence when Next is pressed |
||
UnoFactoryData data = new UnoFactoryData(); | ||
LanguageWizardPage page = lang.getNewWizardPage(); | ||
if (page != null) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -551,12 +551,14 @@ public void doFinish(IProgressMonitor pMonitor, IWorkbenchPage pActivePage) { | |
UnoidlProjectHelper.forceBuild(prj, pMonitor); | ||
|
||
// Create the implementation skeleton | ||
UnoFactoryData wizardSetData = new UnoFactoryData(); | ||
wizardSetData.addInnerData(serviceData); | ||
wizardSetData.setProperty(IUnoFactoryConstants.PROJECT_LANGUAGE, prj.getLanguage()); | ||
wizardSetData.setProperty(IUnoFactoryConstants.PROJECT_NAME, prj.getName()); | ||
UnoFactory.makeSkeleton(wizardSetData, pActivePage, pMonitor); | ||
wizardSetData.dispose(); | ||
if (!prj.getLanguage().getName().contains("Python")) { | ||
UnoFactoryData wizardSetData = new UnoFactoryData(); | ||
wizardSetData.addInnerData(serviceData); | ||
wizardSetData.setProperty(IUnoFactoryConstants.PROJECT_LANGUAGE, prj.getLanguage()); | ||
wizardSetData.setProperty(IUnoFactoryConstants.PROJECT_NAME, prj.getName()); | ||
UnoFactory.makeSkeleton(wizardSetData, pActivePage, pMonitor); | ||
wizardSetData.dispose(); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The makeSkeleton function is actually responsible for creating the <Project_NAME>Impl.java file using the command "uno-skeletonmaker" since this is not of any help towards the python files therefore had to put under the if else condition. "http://bosdonnat.fr/improving-the-uno-skeletonmaker.html" |
||
|
||
} catch (Exception e) { | ||
PluginLogger.error(Messages.getString("ServiceWizardSet.ServiceCreationError"), e); //$NON-NLS-1$ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,6 +147,7 @@ public class NewUnoProjectPage extends WizardNewProjectCreationPage implements I | |
@Override | ||
public void modifyText(ModifyEvent pEvent) { | ||
checkWhiteSpaces(); | ||
checkSpecialSymbolsinProjectName(); | ||
((NewUnoProjectWizard) getWizard()).pageChanged(NewUnoProjectPage.this); | ||
} | ||
}; | ||
|
@@ -410,6 +411,19 @@ private void checkWhiteSpaces() { | |
} | ||
} | ||
|
||
/** | ||
* Shows a error if there are spaces in the project name. | ||
*/ | ||
private void checkSpecialSymbolsinProjectName() { | ||
|
||
if (getProjectName().contains(" ") || getProjectName().contains("_")) { //$NON-NLS-1$ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If '_' is used in the Project name then the <Project_NAME>Impl.java file is not created if projects are created using Java language during New Extension PRoject creation, therefore had to put a check on it. |
||
setMessage(Messages.getString("NewUnoProjectPage.SpecialSymbolsInProjectNameError"), //$NON-NLS-1$ | ||
ERROR); | ||
setPageComplete(false); | ||
} | ||
|
||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These set of changes makes sure that an error sign is shown when there is a space given in the name of the Project and also the Next and Finish button are disabled. |
||
/** | ||
* Add the modify listener to all the Text children of the control. | ||
* | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,6 @@ JODContainerPage.Title=LibreOffice UNO Connector | |
OOoClasspathContainer.LibrariesName={0} libraries | ||
|
||
OOoContainerPage.DialogDescription=LibreOffice Library edition page | ||
OOoContainerPage.DialogImage=/icons/library_wiz.png | ||
OOoContainerPage.DialogImage=/icons/library_wiz.gif | ||
OOoContainerPage.DialogTitle=LibreOffice Libraries | ||
OOoContainerPage.ClasspathSetFailed=Error while setting the project classpath | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the messages.properties file [OOoContainerPage.DialogImage=/icons/library_wiz.png]. When you gor for Right-Click on Java Uno Project -> Java Build Path -> Libraries -> LibreOffice . libraries -> Edit TAG DOWNLOAD inside this I used the icon: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<fileset-config file-format-version="1.2.0" simple-config="true"> | ||
<local-check-config name="style ooeclipseintegration" location="/org.libreoffice.ide.eclipse.build/checkstyle.xml" type="project" description=""> | ||
<additional-data name="protect-config-file" value="true"/> | ||
</local-check-config> | ||
<fileset name="tous" enabled="true" check-config-name="style ooeclipseintegration" local="true"> | ||
<file-match-pattern match-pattern="." include-pattern="true"/> | ||
</fileset> | ||
</fileset-config> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/> | ||
<classpathentry kind="src" path="source"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/ANT"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/LO-Classes"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.libreoffice.ide.eclipse.python</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ManifestBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.SchemaBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>net.sf.eclipsecs.core.CheckstyleBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.pde.PluginNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>net.sf.eclipsecs.core.CheckstyleNature</nature> | ||
</natures> | ||
</projectDescription> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the indentation here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation has been looked after.