Recovery of Qt4 Designer Integration with PyDev for Eclipse neon.2 - eclipse

My Eclipse Neon.2 crashed recently and now the integration of PyQt, in particular the integration with Qt4 Designer seems to have become corrupted. It was the case that I could open a *.ui file from Neon.2 to Qt Designer, make some changes & then run (from Neon.2) a *.py file which accesses the variables created in Qt4D. Now python fails on any new variables I add in Qt4D, but is ok with those created before the crash. I suspect the PyDev integration in my Neon.2 has been corrupted such that the auto pyuic4 does not get run. Question. How do I get out of this mess, eg re-install PyDev in Eclipse (or some other way perhaps)?

Well, PyDev didn't actually do anything automatic in this regard (i.e.: by default it doesn't translate .ui files to .py files with pyiuc4).
The way to do that automatically would be creating a custom builder (right click a project > properties > builders > new > program) and then configure it to run some program which would check if it was a .ui file changed and call pyuic4 on it.
Eclipse external tool for Qt .ui to .py with pyuic has something you could probably use.
Not sure how it worked before for you though... maybe some co-worker had it configured for you or your project already had those settings saved?

Well this does what I wanted:
qtcreator_file = "test1.ui" # Enter file here.
Ui_Dialog, QtBaseClass = uic.loadUiType(qtcreator_file)
My guess is it basically runs something like pyuic4 this avoiding running ones self after having made changes is QtDesigner.

Related

Feature file not getting formatted in Cucumber format

In eclipse, for cucumber feature file using for selenium,
When a feature file was opened, the feature file used to show in cucumber/gherkin format which doesn't show anymore.
When a feature file is created, sample features used to be created
When a feature is executed using dry run, Step definitions used to be created.
src/test/java and src/test/resources are showing greyed out in eclipse which was not the case.
Above mentioned three things are not happening any more which used to work earlier. I believe it's related to the set up of eclipse. I know the issue, not sure what details might be required. So please do let me know what might be required so that I can share here.
Eclipse Version:
Version: 2019-09 R (4.13.0)
Build id: 20190917-1200
That means either your editor is disable or corrupted.
1)
Try to open your feature file again as below:
Select other if cucmber editor not shown.
2)
Uninstall the cucumber plugin and install again.
Refer below link to uninstall the plugin from eclipse
Correct way to remove plugin from Eclipse
When a feature file was opened, the feature file used to show in
cucumber/gherkin format which doesn't show anymore.
Changed the default editor to cucumber, Not sure how default editor
was changed
When a feature file is created, sample features used to be created
After changing the default editor to cucumber, this started working
When a feature is executed using dry run, Step definitions used to
be created.
Added this parameter in the
#CucumberOptions(plugin = {"pretty","summary"})
src/test/java and src/test/resources are showing greyed out in
eclipse which was not the case.
Not sure, but this is not creating any issues so far
Associating feature file type with cucumber in Selenium WebDriver
I don't know the reason but I am also having a similar problem occasionally. When you over the file name go to the file tab and choose properties and then choose Associate with File Type --> then choose cucumber. I hope it helps.

Does Eclipse store any information out of its directory?

I have used Eclipse Indigo (C/C++) for sometime along with PyDev Plugin (for Python). As I messed up with the IDE (tried to tweak some core files, for fun!), I thought to install a fresh one and this time I downloaded Eclipse Indigo (for Java).
Eclipse (C/C++) was placed in C:/
Eclipse (Java) was even placed in C:/
Now when I opened Eclipse (Java), I observed two things:
The Eclipse's title bar still showing <C/C++ Eclipse>
There was a python's project file still opened up which I worked on Eclipse C/C++ IDE. Also, there was an PyDev's error popped up (mentioning it wasn't installed).
I have verified "Installed Plugins" list and didn't find any plugin related to C/C++ or python.
Now, I have got one question:
As I searched over google and found that Eclipse doesn't store anything beyond its directory, How does this above things are showing up??
There might be some Temp/ Cache files stored. However, I searched my drive with "Eclipse" and "PyDev" as keywords and found nothing.
I even searched for registry keys but couldn't find anything.
What exactly is happening and how do remove Eclipse completely?
TL;DR: using the new Eclipse (Java), select "File > Switch Workspace... > Other...", and create a new directory (e.g. java-wks) for all projects you will do using the new Eclipse.
The long explanantion is that Eclipse stores data in two locations:
The eclipse installation directory itself: contains the plug-ins you install (including the ones already installed in the package you downloaded) and some runtime configuration parameters (see eclipse/config.ini) related to how Eclipse itself should run (e.g. where to find the JRE to execute Eclipse itself, how much memory to allocate etc.)
The workspace(s), where your data (projects and source code) and all personal configuration parameters are stored. This is where Eclipse remembers where your source code is, which file(s) where opened when you last exited, which perspective was active (in your case C/C++ Eclipse), your preferences, launch configurations, breakpoints, etc.
For each Eclipse installation on your system (eclipse folder), you can have as many workspaces as you want (it helps to isolate work). There are various ways to select the workspace location: using the -data <path-to-workspace> option on the command-line, using the popup Eclipse normally shows when starting up (but you may have disabled it), or using "File > Switch Workspace...".
You can also use the same workspace from different Eclipse installations (though not at the same time), but things will not work well if you have different plug-ins installed in each: if one installation stores in the workspace "this is a Python project, and the current perspective is C/++", and the other installation does not have the Python and/or C++ plug-ins installed, it will not known what to do with these info. This is why you see the errors you reported.
For your case, my guess is that under Windows the default workspace location is somewhere in your home directory, and the new (Java) Eclipse is using that, but failing to make sense of the Python and C++ related preferences and projects the previous Eclipse stored there. You need to use a fresh workspace not "polluted" with Python and C++ stuff if you want the Java Eclipse to work without errors (or install the Python and C++ plug-ins in the new Eclipse). You may want to enable the Prompt for workspace on startup preference (in "General > Startup and Shutdown > Workspaces") if it is not to control this easily each time Eclipse starts.

Importing Eclipse Plugin source in Eclipse

I have the source code for the VersionOne plugin. I am wanting to modify the code because I am getting a NullPointerException when I click a specific button on the plugin which crashes eclipse. I was wondering what steps I need to take in eclipse to import the source code, modify it, and get it to run. I have read over how to create a new plugin project, but I have never tried importing a plugin before. Plugin Source
Once you have imported the project and that seems to work fine, just run it like any other plugin.
I.e:
Set the breakpoints you want in the code
Click the "Run as..."
In the run dialog start up a new Eclipse instance
On the tab "plugins" make sure your imported plugin is selected
If you are using the plugin at the same time, make sure that the non-workspace is not selected
In the new Eclipse instance, set up a situation that will provoke the bug
You need the following things to do that:
From Eclipse download a distro with PDE (Plugin Development) included.
The source pages
Some configuration management tool like Git or Subversion.
You do then the following steps:
Unzip your sources locally somewhere and add them to the CM system.
Create an eclipse plugin project from that source location (depending on Git or SVN different steps).
Create a run configuration for Eclipse that includes that plugin. That is similar to creating a run configuration for Java, but your Java application is then eclipse (see the Help on Eclipse Application Launcher). You have to ensure that in the "Plug-ins Tab", your new plugin is included. After you have started it, you should see the new feature implemented in the new running eclipse. To debug it, you just have to press the debug button instead of the run button. You may then add breakpoints to the source code of your plugin to see how it is working.
You are then able to start a new eclipse application which includes the plugin and make your tests there. You are able to set breakpoints, debug the code and so on. If you find the error, you can change the code, test it, and as a result have a difference to the source you had initially. The best would be then to make a patch and send it back to the originator.
To deploy it then to others is a different story, and is well documented.

Eclipse hangs while opening workspace after upgrading to GWT 2.0/Google app engine 1.2.8

After upgrading to the newest GWT/Google app engine I have problems opening my workspace in Eclipse. On startup, Eclipse hangs almost immediately and needs to be closed. This happens only in the workspace where I use GWT with app engine, and I weren't able to consistently reproduce it - sometimes it starts normally, and sometimes I need to kill the proces and restart it. There is nothing in Eclipse error log. Eclipse version is Galileo, running on Windows 7 RC.
Anyone else had similar problems? I googled but Google is not my friend today.
EDIT: Still happens after upgrading to GWT 2.0.1.
I got frustrated with not being able to open my workspace today, and finally solved this by importing projects into a new clean workspace.
Create new workspace and open it in Eclipse (to create .metadata folder).
Close Eclipse.
Manually copy all settings from old workspace (the most important settings are stored in the .metadata/.plugins/org.eclipse.core.runtime/.settings directory). Alternatively, you could use File / Export / General / Preferences in Eclipse, and then File / Import them, but I wasn't able to open workspace to do that.
Open the new workspace.
File / Import / General / Existing projects into workspace. Select root folder of your old workspace, and take care to check "Copy project into workspace".
Restart Eclipse and check that everything in the new workspace is working as it should.
Delete your old workspace.
EDIT: Another, and a bit better workaround which apparently works:
Close Eclipse.
Temporary move offending project somewhere out of the workspace.
Start Eclipse, wait for workspace to load (it should).
Close Eclipse again.
Move the project back to workspace.
I used "eclipse -refresh". Apparently it hangs on refresh something, the lower right corner tells you, what it's doing. For me it was refreshing the gwt runtime in a specific project, maybe trying to find an update or something. If you don't want to reimport your whole workspace, try -refresh or move this project temporarily out of the way.
I just deleted the state.dat file in the GWT project metadata, which seemed to remove the blocking and then triggered a recompilation.
<workspace>/.metadata/.plugins/org.eclipse.core.resources/.projects/<GWT project>/org.eclipse.jdt.core/state.dat
This probably won't serve as a general solution, but it worked for me and it's a lot quicker than having to copy whole projects. Maybe another file will have the same effect. I think the trick is just to "damage" the GWT project metadata enough to have it rebuilt.

Migrating From NetBeans to Eclipse

My company wants to migrate to Eclipse, I was wondering what options besides an Ant build are there to move our projects from Netbeans to Eclipse.
Tooooo ... oooo .... oooo late to answer but this works
http://www.coderanch.com/t/458555/vc/Export-Netbeans-Eclipse
i was looking for an answer my self and saw this question :)
Quoting:
Here is a little tutorial on "Importing projects from NetBeans to Eclipse".
Please try this:
PART I - NETBEANS
Open NebBeans.
Create a java project named "ToEclipse".
Build this project.
Then, NetBeans has created several folders. The important folders to us are (in my computer):
c:\User\Almir\NetBeans\ToEclipse\dist
c:\User\Almir\NetBeans\ToEclipse\src
PART II - ECLIPSE
Go to Eclipse.
Create a java project in Eclipse named "ToEclipse".
Then, Eclipse has created several folders. The important folders to us are (in my computer):
c:\Users\Almir\Eclipse\ToEclipse\bin
c:\Users\Almir\Eclipse\ToEclipse\src
PART III - WINDOWS EXPLORER
Go to Windows Explorer.
Copy the FILE "ToEclipse.jar" at c:\Users\Almir\Eclipse\ToEclipse\bin folder.
Past it in c:\Users\Almir\Eclipse\ToEclipse\bin
Copy the FOLDER "toeclipse" at c:\User\Almir\NetBeans\ToEclipse\src folder.
Past it in b) c:\Users\Almir\Eclipse\ToEclipse\src folder.
PART IV - ECLIPSE
Go to Eclipse.
Press F5 to refresh the view.
Verify that your project is there (under ToEclipse/src/toeclipse).
Say "Oh! Yes! It works!".
Run the project.
Return to 3) how many times you want!
I hope that helps you!
Kind regards,
Almir Campos
São Paulo, Brazil.
I found another easier way that worked for me at least since I had problems importing the Ant build script due to a missing javac.
Say you have your Netbeans project (src, build, dist etc) in D:/blah/
In Eclipse go to File->New->Java Project
Uncheck 'Use default location' and instead use the path where the Netbeans project is (D:/blah/) Eclipse should automatically populate everything else and link to the files as well.
I have recently 'migrated' from Netbeans to Eclipse and found it amazingly easy. The reason it was easy though is that all of our projects are IDE independent standard ant and ivy build scripts that most modern IDE's can understand. This way, we all get to use the IDE we like (yes - emacs and vi too) and their are no 'migration' issues.
The reason that I am pointing that out is that, if it is not already that way, I would recommend that you take that same path on your migration. Just create some standard ant (and ivy) build scripts. Eclipse knows how to slurp those in and there will be no future migration issues.
in MY PERSONAL experience, it was easy. I was migrating a java desktop app from netbeans to eclipse. Just copy my projects into the workspace, create the project in eclipse as a new java project and put the same name of the project in netbeans (use your workspace as location). It will recognize the project structure ( Eclipse Helios, Netbeans 6.8 )
Hope this helps. I don't know how hard it turns if you have another kind of project.
I just migrated a Netbeans 7.0 JSF web project to Eclipse. And it was easier than i would have imagined.
What i did was:
List item
Clean and build my JSF application in netbeans
Close netbeans and open Eclipse(i use galileo)
Create a new Dynamic Web Application.
Right click on the new web application in project explorer and go to import then to .WAR file
It then ask whether i want to import any of the jar files(libraries) as projects and i do not select any and just click finish.
Copied my netbeans src(source) folder /src/java/ to
the Eclipse src folder. e.g netbeansproject/medman/src/java/com to eclipseSpace/medman/src/
Next setup your server in Eclipse(i use tomcat 6.0).
And voila! it is done.
You can also check out this link. http://www.coderanch.com/t/458555/vc/Export-Netbeans-Eclipse
At my company people pretty much use either eclipse or Netbeans. I myself use both of them for various tasks. We write our own ant scripts to build and package our source so it does not matter what IDE a person uses. I would suggest that you create your own ant script to build your source, that way you won't have to depend on an IDE specific build script.