36 |
36 |
import java.net.URL;
|
37 |
37 |
import java.util.List;
|
38 |
38 |
|
|
39 |
import javax.swing.JEditorPane;
|
39 |
40 |
import javax.swing.JPanel;
|
40 |
41 |
import javax.swing.JScrollPane;
|
41 |
42 |
import javax.swing.JTable;
|
42 |
|
import javax.swing.JTextArea;
|
43 |
|
import javax.swing.JTextPane;
|
44 |
43 |
import javax.swing.event.ListSelectionEvent;
|
45 |
44 |
import javax.swing.event.ListSelectionListener;
|
46 |
45 |
import javax.swing.table.TableColumnModel;
|
... | ... | |
72 |
71 |
protected SwingInstallerManager swingInstallerManager = null;
|
73 |
72 |
|
74 |
73 |
private JScrollPane descriptionScrollPane;
|
75 |
|
private JTextArea descriptionTextArea;
|
76 |
|
private JTextPane descriptionTextPane;
|
|
74 |
private JEditorPane descriptionTextEditor;
|
77 |
75 |
private JScrollPane pluginsScrollPane;
|
78 |
76 |
private JTable pluginsTable;
|
79 |
77 |
private PackagePropertiesFilterPanel filterPanel;
|
... | ... | |
111 |
109 |
|
112 |
110 |
pluginsScrollPane = new JScrollPane(pluginsTable);
|
113 |
111 |
|
114 |
|
descriptionTextArea = new JTextArea();
|
115 |
|
descriptionTextArea.setEditable(false);
|
116 |
|
descriptionTextArea.setBackground(Color.WHITE);
|
117 |
|
descriptionTextArea.setColumns(20);
|
118 |
|
descriptionTextArea.setRows(5);
|
|
112 |
// descriptionTextArea = new JTextArea();
|
|
113 |
// descriptionTextArea.setEditable(false);
|
|
114 |
// descriptionTextArea.setBackground(Color.WHITE);
|
|
115 |
// descriptionTextArea.setColumns(20);
|
|
116 |
// descriptionTextArea.setRows(5);
|
119 |
117 |
|
120 |
|
descriptionTextPane = new JTextPane();
|
121 |
|
descriptionTextPane.setEditable(false);
|
|
118 |
descriptionTextEditor = new JEditorPane();
|
|
119 |
descriptionTextEditor.setBackground(Color.WHITE);
|
|
120 |
descriptionTextEditor.setEditable(false);
|
|
121 |
descriptionTextEditor.setContentType("text/html");
|
122 |
122 |
|
123 |
|
descriptionScrollPane = new JScrollPane(descriptionTextArea);
|
|
123 |
// descriptionScrollPane = new JScrollPane(descriptionTextArea);
|
|
124 |
descriptionScrollPane = new JScrollPane(descriptionTextEditor);
|
124 |
125 |
|
125 |
126 |
filterPanel = new PackagePropertiesFilterPanel(this);
|
126 |
127 |
filterPanel.setVisible(true);
|
... | ... | |
222 |
223 |
if (code == null || code.equals("")) {
|
223 |
224 |
code = "";
|
224 |
225 |
} else {
|
225 |
|
code = "Code: " + code + "\n";
|
|
226 |
code = "<li type='circle'>Code: " + code + "</li>";
|
226 |
227 |
}
|
227 |
228 |
|
228 |
229 |
String name = ((PackagesTableModel) pluginsTable.getModel())
|
... | ... | |
230 |
231 |
if (name == null || name.equals("")) {
|
231 |
232 |
name = "";
|
232 |
233 |
} else {
|
233 |
|
name = name + "\n";
|
|
234 |
name = name + "<br>";
|
234 |
235 |
}
|
235 |
236 |
|
236 |
237 |
String owner = ((PackagesTableModel) pluginsTable.getModel())
|
... | ... | |
238 |
239 |
if (owner == null || owner.equals("")) {
|
239 |
240 |
owner = "";
|
240 |
241 |
} else {
|
241 |
|
owner = "Owner: " + owner + "\n";
|
|
242 |
owner = "<li type='circle'>Owner: " + owner + "</li>";
|
242 |
243 |
}
|
243 |
|
|
|
244 |
|
244 |
245 |
String ownerUrlStr;
|
245 |
246 |
URL ownerURL = ((PackagesTableModel) pluginsTable.getModel())
|
246 |
247 |
.getOwnerUrlAt(row);
|
247 |
248 |
if (ownerURL == null) {
|
248 |
249 |
ownerUrlStr = "";
|
249 |
250 |
} else {
|
250 |
|
ownerUrlStr = "Owner URL: " + ownerURL.toString() + "\n";
|
|
251 |
ownerUrlStr = "<li type='circle'>Owner URL:" + ownerURL.toString() + "</li>";
|
251 |
252 |
}
|
252 |
253 |
|
253 |
254 |
String sources;
|
... | ... | |
256 |
257 |
if (sourcesURL == null) {
|
257 |
258 |
sources = "";
|
258 |
259 |
} else {
|
259 |
|
sources = "Sources: " + sourcesURL.toString() + "\n";
|
|
260 |
String sourcesb = "Sources:" + sourcesURL.toString();
|
|
261 |
sources = "<li type='circle'>" + sourcesb + "</li>";
|
260 |
262 |
}
|
261 |
263 |
|
262 |
264 |
String description = ((PackagesTableModel) pluginsTable.getModel())
|
... | ... | |
264 |
266 |
if (description == null) {
|
265 |
267 |
description = "";
|
266 |
268 |
} else {
|
267 |
|
description = description + "\n";
|
|
269 |
description = description + "<br>";
|
268 |
270 |
}
|
269 |
271 |
|
270 |
272 |
String depends = "";
|
271 |
273 |
Dependencies dependencies = ((PackagesTableModel) pluginsTable
|
272 |
274 |
.getModel()).getPackageInfoAt(row).getDependencies();
|
273 |
275 |
if (dependencies != null && !dependencies.isEmpty()) {
|
274 |
|
depends = "Dependencies: " + dependencies.toString() + "\n";
|
|
276 |
depends = "<li type='circle'>Dependencies: " + dependencies.toString() + "</li>";
|
275 |
277 |
}
|
276 |
278 |
|
277 |
279 |
String categories = ((PackagesTableModel) pluginsTable.getModel())
|
... | ... | |
279 |
281 |
if (categories == null || categories.equals("")) {
|
280 |
282 |
categories = "";
|
281 |
283 |
} else {
|
282 |
|
categories = "Categories: " + categories + "\n";
|
|
284 |
categories = "<li type='circle'>Categories: " + categories + "</li>";
|
283 |
285 |
}
|
284 |
286 |
|
285 |
|
String descriptionText = name + "\n" + description + "\n" + code
|
286 |
|
+ owner + ownerUrlStr + sources + depends + categories;
|
|
287 |
//sets the html format
|
|
288 |
String descriptionTextHtml = "<b>" + name + "</b>" + "<br><font size='-1'>"
|
|
289 |
+ description + "<br></font><hr /><font size='-1'>" + code + owner
|
|
290 |
+ ownerUrlStr + sources + depends + categories + "</font>";
|
287 |
291 |
|
288 |
|
descriptionTextArea.setText(descriptionText.trim());
|
|
292 |
descriptionTextEditor.setText(descriptionTextHtml);
|
289 |
293 |
|
290 |
294 |
// get the view area to the top-left corner
|
291 |
|
descriptionTextArea.setCaretPosition(0);
|
|
295 |
descriptionTextEditor.setCaretPosition(0);
|
292 |
296 |
|
293 |
297 |
}
|
294 |
298 |
}
|
... | ... | |
332 |
336 |
|
333 |
337 |
public void clearAllPanels() {
|
334 |
338 |
filterPanel.resetPanel();
|
335 |
|
descriptionTextArea.setText("");
|
|
339 |
// descriptionTextArea.setText("");
|
|
340 |
descriptionTextEditor.setText("");
|
336 |
341 |
fastFilterPanel.resetPanel();
|
337 |
342 |
}
|
338 |
343 |
|
339 |
344 |
public void resetPanel() {
|
340 |
345 |
filterPanel.resetPanel();
|
341 |
|
descriptionTextArea.setText("");
|
|
346 |
descriptionTextEditor.setText("");
|
342 |
347 |
}
|
343 |
348 |
|
344 |
349 |
}
|