Eclipse

 

Generating sample XML from XSD or DTD in Eclipse

XMarks XML schema diagram v1.1
Image by carol shergold via Flickr

Feature is useful if you are writing your XSD schema files or you have XSD schema files and want to create sample XML files for schema elements. Process is the same for generating sample XML files from DTD files.

How to do it. Simple.

  1. Create a project and add, import or somehow see created, generated XSD files in Project Explorer.
  2. Select your desired XSD file.
  3. Right-click and choose Generate->XML File
  4. New XML File wizard will pop-up where you define where generated file should be saved and what should be it’s name. When desired information is input-ed press Next.
  5. In Select Root Element window choose root element of your sample XML file. Root element can be any element defined in XSD file you choose to use for generation of the sample XML.
  6. Set content options and pay special attention to optional attributes & optional elements. Check those if you would like a complete XML sample.
  7. Name-space information is populated with name-spaces defined in chosen XSD file. You can manipulate the existing name-space information by changing prefix, adding additional name-space or create new name-space.
  8. Once you are satisfied click Finish.

And presto you have your blank sample XML. Edit it with the information you wish to present and your sample XML is ready. No XMLSpy or any other commercial tools required.

 

Eclipse runs “File Search” when pressing AltGr+G

Croatian and Slovenian keyboard layout
Image via Wikipedia

Did you ever have any problems with Eclipse? With initial versions of Galileo1 and in previously released Gynamed there was a problem with preassigned keyboard shortcuts on some locale’s2. The problem that Eclipse created when using Slovene keyboard layout was that while programmer wanted to type the ] key, Eclipse run File Search action.

Slovenian users are not to blame that their keyboard has ] key mapped to AltGr+G key combination. And Eclipse developers could browse through Wikipedia to discover what obscure keyboard layouts exist.

Any competent programmer will notice that with the default key mapping Eclipse guards programmers from using too many arrays since typically array is marked with [] key combination. They are advancing object oriented design and programming. But in some cases arrays actually make your code faster and optimize memory usage and fragmentation.

To discover how to remedy the problem read on. READ MORE

  1. should be corrected in 3.5 []
  2. Slovenian and Hungarian, if my memory serves me []
 

Eclipse Galileo and SVN support

Like many Java developers I had to take a look at Eclipse Galileo. My interest lie in how fast I can migrate from Eclipse Europa to new Galileo version.

Installation was as simple as in previous version. Extract an archive file to a directory. Simple eh ? Let’s see what will be broken. Upon first start Galileo tries to move my default workspace. Well I choose my old workspace and by some magic it was opened without problems. Or did it? Recompilation and reformatting took about a minute or two1. After that everything worked smoothly. Almost everything.  Project team collaboration vanished.

“GULP”, was my first reaction. CVS support is included, but who really uses CVS nowadays? So I found out that setting up SVN in Eclipse Galileo was not as simple as I thought it to be.

  1. Help->Install New Software
  2. Choose to work with Galileo – http://download.eclipse.org/releases/galileo
  3. Unfold Collaboration
  4. Choose Subversive SVN Team Provider (Incubation)
  5. I employ you to restart Eclipse and don’t use any plugin at this point since they will not work and you will get a message which is similar to this: 0x0040010b: Obtain Project Name’ operation finished with error: Selected SVN connector library is not available or cannot be loaded …’. Instead you rather install a connector library.
  6. Help->Install New Software
  7. Add a site
  8. I used: http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/ , but you can probably use any other that has SVNKit or JavaHL connector
  9. Unfold Subversive SVN Connectors
  10. Select Subversive SVN Connectors, SVNKit (1.3.0), JavaHL (1.6.0) and it’s native libraries.
  11. Restart Eclipse
  12. Configure SVN Connector by specifying the connector in Window->Preferences->Team->SVN->SVN Connector.

And there you have it. Eclipse Galileo with SVN support in all its splendor.

Reblog this post [with Zemanta]
  1. it is a huge project tree I am working with []
 

Eclipse Code Assist / Code Completion / Content Assist hang-up

Do you use Eclipse ? Do you use Code Assist? You don’t ? You should :)

You will write your code much faster, and since you will be using CTRL + SPACE combination you will be heard in the office1

I use Eclipse daily and I must say that I am pleased with it. Until the content assist functionality hangs up. Then I am not as pleased as I could have been if it worked. I have to kill the Eclipse process and restart Eclipse or wait a minute or ten for the hang-up to end.

Now until today I couldn’t find the problem for that. As it happened some time ago I installed some plugins for Mylyn which in the process not knowingly changed some of the default setting in my Eclipse preferences. I don’t use Mylyn for task management. Changing the preferences to default values solved my problem.

So if Eclipse starts to hang up during usage of content assist check the:

Preferences->Java->Editor->Content Assist->Advanced section of Eclipse properties.

Enable Other Java Properties and Type Properties. If you are using templates in your code2 then enable Template Properties.

This should solve the problem with content assist hang-ups.

If they persist Documents as You Go has some interesting insight in Logitech Quickcam V10 application issues.

Reblog this post [with Zemanta]
  1. implying that you DO work ;) []
  2. like sysout []

Support Us