author | haismail <hussein.ismail@nokia.com> |
Thu, 18 Feb 2010 08:20:36 +0200 | |
changeset 5 | d5efbe6c22e8 |
parent 2 | a91cb670dd8e |
child 6 | 7f60f3388609 |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
package com.nokia.s60tools.imaker.internal.viewers; |
|
19 |
||
20 |
import java.io.File; |
|
5
d5efbe6c22e8
Ticket #1245: Update target selection required to avoid yellow warnings on content tab
haismail <hussein.ismail@nokia.com>
parents:
2
diff
changeset
|
21 |
import java.util.ArrayList; |
1 | 22 |
import java.util.List; |
0 | 23 |
import java.util.regex.Pattern; |
24 |
||
25 |
import org.eclipse.emf.common.util.EList; |
|
26 |
import org.eclipse.jface.resource.ImageRegistry; |
|
27 |
import org.eclipse.jface.viewers.ColumnLabelProvider; |
|
28 |
import org.eclipse.jface.viewers.ISelection; |
|
29 |
import org.eclipse.jface.viewers.IStructuredContentProvider; |
|
30 |
import org.eclipse.jface.viewers.IStructuredSelection; |
|
31 |
import org.eclipse.jface.viewers.TableViewer; |
|
32 |
import org.eclipse.jface.viewers.TableViewerColumn; |
|
33 |
import org.eclipse.jface.viewers.Viewer; |
|
34 |
import org.eclipse.jface.window.Window; |
|
35 |
import org.eclipse.swt.SWT; |
|
36 |
import org.eclipse.swt.custom.CTabFolder; |
|
37 |
import org.eclipse.swt.custom.CTabItem; |
|
38 |
import org.eclipse.swt.events.KeyEvent; |
|
39 |
import org.eclipse.swt.events.KeyListener; |
|
40 |
import org.eclipse.swt.events.SelectionEvent; |
|
41 |
import org.eclipse.swt.events.SelectionListener; |
|
42 |
import org.eclipse.swt.graphics.Image; |
|
43 |
import org.eclipse.swt.layout.GridData; |
|
44 |
import org.eclipse.swt.layout.GridLayout; |
|
45 |
import org.eclipse.swt.widgets.Button; |
|
46 |
import org.eclipse.swt.widgets.Composite; |
|
47 |
import org.eclipse.swt.widgets.Control; |
|
48 |
import org.eclipse.swt.widgets.Table; |
|
49 |
||
50 |
import com.nokia.s60tools.imaker.IMakerPlugin; |
|
51 |
import com.nokia.s60tools.imaker.IMakerKeyConstants; |
|
52 |
import com.nokia.s60tools.imaker.Messages; |
|
53 |
import com.nokia.s60tools.imaker.UIConfiguration; |
|
54 |
import com.nokia.s60tools.imaker.UITarget; |
|
55 |
import com.nokia.s60tools.imaker.internal.managers.ProjectManager; |
|
56 |
import com.nokia.s60tools.imaker.internal.model.FileToImage; |
|
57 |
import com.nokia.s60tools.imaker.internal.model.ImakerProperties; |
|
58 |
import com.nokia.s60tools.imaker.internal.model.iContent.IContentFactory; |
|
59 |
import com.nokia.s60tools.imaker.internal.model.iContent.IbyEntry; |
|
60 |
import com.nokia.s60tools.imaker.internal.model.iContent.ImageContent; |
|
61 |
import com.nokia.s60tools.imaker.internal.providers.CheckBoxEditingSupport; |
|
62 |
import com.nokia.s60tools.imaker.internal.providers.ComboEditingSupport; |
|
63 |
import com.nokia.s60tools.imaker.internal.providers.TextEditingSupport; |
|
64 |
||
65 |
public class DebugTab extends CTabItem implements IPropertyViewer { |
|
66 |
public static final String CHECKED_IMAGE = "checked"; |
|
67 |
public static final String UNCHECKED_IMAGE = "unchecked"; |
|
68 |
public static final String WARNING_IMAGE = "warning"; |
|
69 |
public static final String ERROR_IMAGE = "error"; |
|
70 |
public static final String REL_PATTERN = ".*epoc32.release.+?(urel).*"; |
|
71 |
public static final String DEBUG_PATTERN = ".*epoc32.release.+?(udeb).*"; |
|
72 |
||
73 |
// For the checkbox images |
|
74 |
private static ImageRegistry imageRegistry = IMakerPlugin.getDefault().getImageRegistry(); |
|
75 |
||
76 |
private IMakerTabsViewer tabsViewer; |
|
77 |
private ProjectManager projectManager; |
|
78 |
private TableViewer tableViewer; |
|
79 |
private PreferencesTab mainTab; |
|
80 |
||
81 |
static { |
|
82 |
String iconPath = "icons/"; |
|
83 |
imageRegistry.put(CHECKED_IMAGE, IMakerPlugin.getImageDescriptor( |
|
84 |
iconPath + CHECKED_IMAGE + ".gif" |
|
85 |
) |
|
86 |
); |
|
87 |
imageRegistry.put(UNCHECKED_IMAGE, IMakerPlugin.getImageDescriptor( |
|
88 |
iconPath + UNCHECKED_IMAGE + ".gif" |
|
89 |
) |
|
90 |
); |
|
91 |
imageRegistry.put(WARNING_IMAGE, IMakerPlugin.getImageDescriptor( |
|
92 |
iconPath + WARNING_IMAGE + ".gif" |
|
93 |
) |
|
94 |
); |
|
95 |
imageRegistry.put(ERROR_IMAGE, IMakerPlugin.getImageDescriptor( |
|
96 |
iconPath + ERROR_IMAGE + ".gif" |
|
97 |
) |
|
98 |
); |
|
99 |
} |
|
100 |
||
101 |
public DebugTab(CTabFolder parent, int style, IMakerTabsViewer viewer, PreferencesTab main) { |
|
102 |
super(parent, style); |
|
103 |
this.tabsViewer = viewer; |
|
104 |
this.projectManager = tabsViewer.getProjectManager(); |
|
105 |
setControl(createControl(parent)); |
|
106 |
this.mainTab = main; |
|
107 |
} |
|
108 |
||
109 |
private void deleteSelection() { |
|
110 |
ISelection selection = tableViewer.getSelection(); |
|
111 |
if(selection!=null) { |
|
112 |
IStructuredSelection ss = (IStructuredSelection) selection; |
|
113 |
Object[] objects = ss.toArray(); |
|
114 |
for (int i = 0; i < objects.length; i++) { |
|
115 |
IbyEntry fe = (IbyEntry) objects[i]; |
|
116 |
ImageContent ic = getInput(); |
|
117 |
ic.getEntries().remove(fe); |
|
118 |
} |
|
119 |
tableViewer.refresh(); |
|
120 |
} |
|
121 |
} |
|
122 |
||
123 |
private Control createControl(CTabFolder parent) { |
|
124 |
Composite top = new Composite(parent,SWT.NONE); |
|
125 |
top.setLayout(new GridLayout(2,false)); |
|
126 |
top.setLayoutData(new GridData(GridData.FILL_BOTH)); |
|
127 |
||
128 |
// create table |
|
129 |
Composite tableComp = getNewComposite(top); |
|
130 |
Table table = new Table(tableComp,SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI); |
|
131 |
GridData gridData = new GridData(GridData.FILL,GridData.FILL,true,true); |
|
132 |
gridData.heightHint = 180; |
|
133 |
table.setLayoutData(gridData); |
|
134 |
||
135 |
// create controls |
|
136 |
Composite controls = getNewComposite(top); |
|
137 |
Button button = new Button(controls,SWT.PUSH|SWT.LEFT); |
|
138 |
button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
|
139 |
button.setText(Messages.getString("DebugTab.2")); |
|
140 |
button.setToolTipText(Messages.getString("DebugTab.3")); |
|
141 |
button.addSelectionListener(new SelectionListener() { |
|
142 |
||
143 |
// @Override |
|
144 |
public void widgetSelected(SelectionEvent e) { |
|
145 |
IbyEntry entry = IContentFactory.eINSTANCE.createIbyEntry(); |
|
146 |
ImageContent input = getInput(); |
|
147 |
FileToImage file = new FileToImage(); |
|
148 |
AddEditFileToTransferDialog dialog= new AddEditFileToTransferDialog(getControl().getShell(), file); |
|
149 |
dialog.setTitle(Messages.getString("FileTransferTab.8")); |
|
150 |
if (dialog.open() != Window.OK) { |
|
151 |
return; |
|
152 |
} |
|
153 |
entry.setEnabled(file.getEnabled()); |
|
154 |
entry.setFile(file.getHostPath().substring(2)); |
|
155 |
entry.setTarget(file.getTargetPath()); |
|
156 |
entry.setDebug(isDebug(entry.getFile())); |
|
157 |
input.getEntries().add(entry); |
|
158 |
tableViewer.refresh(); |
|
159 |
} |
|
160 |
||
161 |
private boolean isDebug(String file) { |
|
162 |
Pattern p = Pattern.compile(DEBUG_PATTERN); |
|
163 |
return p.matcher(file).find(); |
|
164 |
} |
|
165 |
||
166 |
// @Override |
|
167 |
public void widgetDefaultSelected(SelectionEvent e) { |
|
168 |
widgetSelected(e); |
|
169 |
} |
|
170 |
}); |
|
171 |
||
172 |
button = new Button(controls,SWT.PUSH|SWT.LEFT); |
|
173 |
button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
|
174 |
button.setText(Messages.getString("DebugTab.4")); |
|
175 |
button.setToolTipText(Messages.getString("DebugTab.5")); |
|
176 |
button.addSelectionListener(new SelectionListener() { |
|
177 |
||
178 |
// @Override |
|
179 |
public void widgetSelected(SelectionEvent e) { |
|
180 |
deleteSelection(); |
|
181 |
} |
|
182 |
||
183 |
// @Override |
|
184 |
public void widgetDefaultSelected(SelectionEvent e) { |
|
185 |
widgetSelected(e); |
|
186 |
} |
|
187 |
}); |
|
188 |
||
189 |
button = new Button(controls,SWT.PUSH|SWT.LEFT); |
|
190 |
button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
|
191 |
button.setText(Messages.getString("DebugTab.6")); |
|
192 |
button.setToolTipText(Messages.getString("DebugTab.7")); |
|
193 |
button.addSelectionListener(new SelectionListener() { |
|
194 |
||
195 |
// @Override |
|
196 |
public void widgetSelected(SelectionEvent e) { |
|
197 |
ImageContent input = getInput(); |
|
198 |
if(input!=null) { |
|
199 |
projectManager.populate(input); |
|
200 |
tableViewer.refresh(); |
|
201 |
} |
|
202 |
} |
|
203 |
||
204 |
// @Override |
|
205 |
public void widgetDefaultSelected(SelectionEvent e) { |
|
206 |
widgetSelected(e); |
|
207 |
} |
|
208 |
}); |
|
209 |
||
210 |
Composite enableButtons = new Composite(top,SWT.NONE); |
|
211 |
GridLayout layout = new GridLayout(2, false); |
|
212 |
layout.marginWidth = 0; |
|
213 |
layout.marginHeight = 0; |
|
214 |
enableButtons.setLayout(layout); |
|
215 |
enableButtons.setLayoutData(new GridData()); |
|
216 |
||
217 |
button = new Button(enableButtons,SWT.PUSH|SWT.LEFT); |
|
218 |
button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
|
219 |
button.setText(Messages.getString("DebugTab.8")); |
|
220 |
button.setToolTipText(Messages.getString("DebugTab.9")); |
|
221 |
button.addSelectionListener(new SelectionListener() { |
|
222 |
||
223 |
public void widgetSelected(SelectionEvent e) { |
|
224 |
ImageContent ic = getInput(); |
|
225 |
if(ic!=null) { |
|
226 |
for (IbyEntry entry: ic.getEntries()) { |
|
227 |
entry.setEnabled(true); |
|
228 |
} |
|
229 |
tableViewer.refresh(); |
|
230 |
} |
|
231 |
} |
|
232 |
||
233 |
public void widgetDefaultSelected(SelectionEvent e) { |
|
234 |
widgetSelected(e); |
|
235 |
} |
|
236 |
}); |
|
237 |
||
238 |
button = new Button(enableButtons,SWT.PUSH|SWT.LEFT); |
|
239 |
button.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); |
|
240 |
button.setText(Messages.getString("DebugTab.10")); |
|
241 |
button.setToolTipText(Messages.getString("DebugTab.11")); |
|
242 |
button.addSelectionListener(new SelectionListener() { |
|
243 |
||
244 |
public void widgetSelected(SelectionEvent e) { |
|
245 |
ImageContent ic = getInput(); |
|
246 |
if(ic!=null) { |
|
247 |
for (IbyEntry entry: ic.getEntries()) { |
|
248 |
entry.setEnabled(false); |
|
249 |
} |
|
250 |
tableViewer.refresh(); |
|
251 |
} |
|
252 |
} |
|
253 |
||
254 |
public void widgetDefaultSelected(SelectionEvent e) { |
|
255 |
widgetSelected(e); |
|
256 |
} |
|
257 |
}); |
|
258 |
||
259 |
tableViewer = new TableViewer(table); |
|
260 |
||
261 |
tableViewer.getTable().setHeaderVisible(true); |
|
262 |
tableViewer.getTable().setLinesVisible(true); |
|
263 |
||
264 |
tableViewer.setContentProvider(new DebugContentProvider()); |
|
265 |
||
266 |
createColumns(tableViewer); |
|
267 |
||
268 |
tableViewer.getTable().addKeyListener(new KeyListener() { |
|
269 |
||
270 |
public void keyReleased(KeyEvent e) { |
|
271 |
if(e.character == SWT.DEL) { |
|
272 |
deleteSelection(); |
|
273 |
} |
|
274 |
} |
|
275 |
||
276 |
public void keyPressed(KeyEvent e) { |
|
277 |
} |
|
278 |
}); |
|
279 |
tableViewer.setInput(getDefaultInput()); |
|
280 |
return top; |
|
281 |
} |
|
282 |
||
283 |
private Object getDefaultInput() { |
|
284 |
IContentFactory factory = IContentFactory.eINSTANCE; |
|
285 |
ImageContent ic = factory.createImageContent(); |
|
286 |
return ic; |
|
287 |
} |
|
288 |
||
289 |
private Composite getNewComposite(Composite top) { |
|
290 |
Composite comp = new Composite(top,SWT.NONE); |
|
291 |
GridLayout layout = new GridLayout(1, true); |
|
292 |
layout.marginWidth = 0; |
|
293 |
layout.marginHeight = 0; |
|
294 |
comp.setLayout(layout); |
|
295 |
GridData layoutData = new GridData(GridData.FILL_BOTH); |
|
296 |
layoutData.grabExcessHorizontalSpace = true; |
|
297 |
comp.setLayoutData(layoutData); |
|
298 |
return comp; |
|
299 |
} |
|
300 |
||
301 |
private void createColumns(TableViewer viewer) { |
|
302 |
int columnSizes[] = {20,50,130,130,60,50}; |
|
303 |
||
304 |
TableViewerColumn column = new TableViewerColumn(viewer,SWT.NONE); |
|
305 |
column.getColumn().setText("!"); |
|
306 |
column.getColumn().setWidth(columnSizes[0]); |
|
307 |
column.setLabelProvider(new ColumnLabelProvider() { |
|
308 |
||
309 |
@Override |
|
310 |
public Image getImage(Object element) { |
|
311 |
if(isWarning(element)) { |
|
312 |
return imageRegistry.get(WARNING_IMAGE); |
|
313 |
} else if(isError(element)) { |
|
314 |
return imageRegistry.get(ERROR_IMAGE); |
|
315 |
} else { |
|
316 |
return null; |
|
317 |
} |
|
318 |
} |
|
319 |
||
320 |
private IbyEntry getEntry(Object element) { |
|
321 |
return (IbyEntry) element; |
|
322 |
} |
|
323 |
||
324 |
private boolean isWarning(Object element) { |
|
325 |
IbyEntry entry = getEntry(element); |
|
2 | 326 |
String location = " "+entry.getLocation().toString().toUpperCase()+" "; |
0 | 327 |
String targets[] = mainTab.getSelectedTargets(); |
328 |
UIConfiguration pr = mainTab.getSelectedProduct(); |
|
329 |
for (int i = 0; i < targets.length; i++) { |
|
330 |
String t = targets[i]; |
|
331 |
UITarget target = pr.getTarget(t); |
|
332 |
if(target!=null&&target.getSteps()!=null) { |
|
333 |
int index = target.getSteps().indexOf(location); |
|
334 |
if(index!=-1) { |
|
335 |
return false; |
|
336 |
} |
|
337 |
} |
|
338 |
} |
|
5
d5efbe6c22e8
Ticket #1245: Update target selection required to avoid yellow warnings on content tab
haismail <hussein.ismail@nokia.com>
parents:
2
diff
changeset
|
339 |
mainTab.addTarget(entry.getLocation().getName()); |
d5efbe6c22e8
Ticket #1245: Update target selection required to avoid yellow warnings on content tab
haismail <hussein.ismail@nokia.com>
parents:
2
diff
changeset
|
340 |
return false; |
0 | 341 |
} |
342 |
||
343 |
private boolean isError(Object element) { |
|
344 |
IbyEntry entry = getEntry(element); |
|
345 |
String path = projectManager.getRoot()+entry.getFile(); |
|
346 |
File f = new File(path); |
|
347 |
if(!f.exists()) { |
|
348 |
String message = Messages.getString("DebugTab.1"); |
|
349 |
entry.setStatusMessage(message.replace("xxx", f.getAbsolutePath())); |
|
350 |
return true; |
|
351 |
} |
|
352 |
return false; |
|
353 |
} |
|
354 |
||
355 |
||
356 |
@Override |
|
357 |
public String getText(Object element) { |
|
358 |
if(isWarning(element) || isError(element)) { |
|
359 |
return getEntry(element).getStatusMessage(); |
|
360 |
} |
|
361 |
return ""; |
|
362 |
} |
|
363 |
||
364 |
}); |
|
365 |
column.setEditingSupport(new CheckBoxEditingSupport(viewer, 0)); |
|
366 |
||
367 |
column = new TableViewerColumn(viewer,SWT.CENTER); |
|
368 |
column.getColumn().setText("Enable"); |
|
369 |
column.getColumn().setWidth(columnSizes[1]); |
|
370 |
column.setLabelProvider( new ColumnLabelProvider() { |
|
371 |
||
372 |
@Override |
|
373 |
public Image getImage(Object element) { |
|
374 |
IbyEntry ie = (IbyEntry) element; |
|
375 |
String key = ie.isEnabled() ? CHECKED_IMAGE : UNCHECKED_IMAGE; |
|
376 |
return imageRegistry.get(key); |
|
377 |
} |
|
378 |
||
379 |
@Override |
|
380 |
public String getText(Object element) { |
|
381 |
return ""; |
|
382 |
} |
|
383 |
}); |
|
384 |
column.setEditingSupport(new CheckBoxEditingSupport(viewer, 1)); |
|
385 |
||
386 |
column = new TableViewerColumn(viewer,SWT.NONE); |
|
387 |
column.getColumn().setText("File"); |
|
388 |
column.getColumn().setWidth(columnSizes[2]); |
|
389 |
column.setLabelProvider(new ColumnLabelProvider() { |
|
390 |
@Override |
|
391 |
public String getText(Object element) { |
|
392 |
IbyEntry e = (IbyEntry) element; |
|
393 |
return e.getFile(); |
|
394 |
} |
|
395 |
}); |
|
396 |
column.setEditingSupport(new TextEditingSupport(viewer,2)); |
|
397 |
||
398 |
||
399 |
column = new TableViewerColumn(viewer,SWT.NONE); |
|
400 |
column.getColumn().setText("Target"); |
|
401 |
column.getColumn().setWidth(columnSizes[3]); |
|
402 |
column.setLabelProvider(new ColumnLabelProvider() { |
|
403 |
@Override |
|
404 |
public String getText(Object element) { |
|
405 |
IbyEntry e = (IbyEntry) element; |
|
406 |
return e.getTarget(); |
|
407 |
} |
|
408 |
}); |
|
409 |
column.setEditingSupport(new TextEditingSupport(viewer,3)); |
|
410 |
||
411 |
column = new TableViewerColumn(viewer,SWT.NONE); |
|
412 |
column.getColumn().setText("Location"); |
|
413 |
column.getColumn().setWidth(columnSizes[4]); |
|
414 |
column.setLabelProvider(new ColumnLabelProvider() { |
|
415 |
@Override |
|
416 |
public String getText(Object element) { |
|
417 |
IbyEntry e = (IbyEntry) element; |
|
418 |
return e.getLocation().getLiteral(); |
|
419 |
} |
|
420 |
}); |
|
421 |
column.setEditingSupport(new ComboEditingSupport(viewer,4)); |
|
422 |
||
423 |
column = new TableViewerColumn(viewer,SWT.CENTER); |
|
424 |
column.getColumn().setText("Debug"); |
|
425 |
column.getColumn().setWidth(columnSizes[5]); |
|
426 |
column.setLabelProvider( new ColumnLabelProvider() { |
|
427 |
||
428 |
@Override |
|
429 |
public Image getImage(Object element) { |
|
430 |
IbyEntry ie = (IbyEntry) element; |
|
431 |
String key = ie.isDebug() ? CHECKED_IMAGE : UNCHECKED_IMAGE; |
|
432 |
return imageRegistry.get(key); |
|
433 |
} |
|
434 |
||
435 |
@Override |
|
436 |
public String getText(Object element) { |
|
437 |
return ""; |
|
438 |
} |
|
439 |
}); |
|
440 |
column.setEditingSupport(new CheckBoxEditingSupport(viewer, 5)); |
|
441 |
} |
|
442 |
||
443 |
||
444 |
private class DebugContentProvider implements IStructuredContentProvider { |
|
445 |
||
446 |
// @Override |
|
447 |
public Object[] getElements(Object inputElement) { |
|
448 |
ImageContent ic = (ImageContent) inputElement; |
|
449 |
return ic.getEntries().toArray(); |
|
450 |
} |
|
451 |
||
452 |
// @Override |
|
453 |
public void dispose() { |
|
454 |
} |
|
455 |
||
456 |
// @Override |
|
457 |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { |
|
458 |
} |
|
459 |
} |
|
460 |
||
461 |
/* (non-Javadoc) |
|
462 |
* @see com.nokia.s60tools.imaker.internal.viewers.IPropertyViewer#addToProperties(com.nokia.s60tools.imaker.internal.model.ImakerProperties) |
|
463 |
*/ |
|
464 |
public void addToProperties(ImakerProperties prop) { |
|
465 |
ImageContent input = getInput(); |
|
5
d5efbe6c22e8
Ticket #1245: Update target selection required to avoid yellow warnings on content tab
haismail <hussein.ismail@nokia.com>
parents:
2
diff
changeset
|
466 |
List<IbyEntry> ls = new ArrayList<IbyEntry>(); |
d5efbe6c22e8
Ticket #1245: Update target selection required to avoid yellow warnings on content tab
haismail <hussein.ismail@nokia.com>
parents:
2
diff
changeset
|
467 |
ls.addAll(input.getEntries()); |
d5efbe6c22e8
Ticket #1245: Update target selection required to avoid yellow warnings on content tab
haismail <hussein.ismail@nokia.com>
parents:
2
diff
changeset
|
468 |
prop.put(IMakerKeyConstants.DEBUGFILES, ls); |
1 | 469 |
|
0 | 470 |
} |
471 |
||
472 |
/* (non-Javadoc) |
|
473 |
* @see com.nokia.s60tools.imaker.internal.viewers.IPropertyViewer#restoreFromProperties(com.nokia.s60tools.imaker.internal.model.ImakerProperties) |
|
474 |
*/ |
|
475 |
public void restoreFromProperties(ImakerProperties prop) { |
|
476 |
ImageContent input = getInput(); |
|
477 |
EList<IbyEntry> entries = input.getEntries(); |
|
1 | 478 |
entries.clear(); |
479 |
Object ents = prop.get(IMakerKeyConstants.DEBUGFILES); |
|
480 |
if(ents!=null) { |
|
481 |
List<IbyEntry> ls = (List<IbyEntry>) ents; |
|
482 |
entries.addAll(ls); |
|
0 | 483 |
} |
1 | 484 |
tableViewer.refresh(); |
0 | 485 |
} |
486 |
||
487 |
private ImageContent getInput() { |
|
488 |
return (ImageContent) tableViewer.getInput(); |
|
489 |
} |
|
490 |
||
491 |
public void refesh() { |
|
492 |
tableViewer.refresh(); |
|
493 |
} |
|
494 |
||
495 |
// @Override |
|
496 |
public void clear() { |
|
497 |
getInput().getEntries().clear(); |
|
498 |
refesh(); |
|
499 |
} |
|
500 |
} |