Revision 75 trunk/org.gvsig.scripting/org.gvsig.scripting.api/src/main/java/org/gvsig/scripting/swing/composer/JImportHelp.java

View differences:

JImportHelp.java
107 107
				if(this.manager.existsHelp(name.getText())){
108 108
					JOptionPane.showMessageDialog(null, "This name already exists\nPlease, choose another one", "Error", JOptionPane.ERROR_MESSAGE);
109 109
				}else{
110
					//Importar
111
					File file = new File(from.getText());
112
					URL url= null;
113
					try {
114
						
115
						url = file.toURL();
116
					} catch (MalformedURLException e) {
117
						// TODO Auto-generated catch block
118
						e.printStackTrace();
110
					File packageListFile = new File(from.getText()+File.separator+"package-list");
111
					if(packageListFile.exists()){
112
						//Importar
113
						File file = new File(from.getText());
114
						URL url= null;
115
						try {
116
							url = file.toURL();
117
						} catch (MalformedURLException e) {
118
							// TODO Auto-generated catch block
119
							e.printStackTrace();
120
						}
121
						if (url!= null){
122
							this.manager.importHelp(name.getText(), url);
123
							setVisible(false);
124
							JOptionPane.showMessageDialog(null, "Import JavaDoc successfully", "Info", JOptionPane.INFORMATION_MESSAGE);
125
							this.uimanager.getHelpDialog();
126
						}
127
					}else{
128
						JOptionPane.showMessageDialog(null, "This folder haven't got a 'package-list' file to make the JavaDoc\nPlease, choose another one", "Error", JOptionPane.ERROR_MESSAGE);
119 129
					}
120
					if (url!= null){
121
						this.manager.importHelp(name.getText(), url);
122
						setVisible(false);
123
						JOptionPane.showMessageDialog(null, "Import JavaDoc successfully", "Info", JOptionPane.INFORMATION_MESSAGE);
124
						this.uimanager.getHelpDialog();
125
					}
126 130
				}
127 131
			}
128 132
		}

Also available in: Unified diff