Commit | Line | Data |
---|---|---|
73005152 BH |
1 | /********************************************************************** |
2 | * Copyright (c) 2005, 2008, 2011 IBM Corporation and others. | |
3 | * All rights reserved. This program and the accompanying materials | |
4 | * are made available under the terms of the Eclipse Public License v1.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * http://www.eclipse.org/legal/epl-v10.html | |
7 | * $Id: SDPrintDialogUI.java,v 1.3 2008/01/24 02:28:52 apnan Exp $ | |
8 | * | |
9 | * Contributors: | |
10 | * IBM - Initial API and implementation | |
11 | * Bernd Hufmann - Updated for TMF | |
12 | **********************************************************************/ | |
13 | package org.eclipse.linuxtools.tmf.ui.views.uml2sd.util; | |
14 | ||
15 | import java.text.MessageFormat; | |
16 | import java.util.Arrays; | |
17 | ||
18 | import org.eclipse.jface.dialogs.MessageDialog; | |
19 | import org.eclipse.jface.wizard.WizardPage; | |
20 | import org.eclipse.linuxtools.tmf.ui.viewers.timeAnalysis.GridUtil; | |
21 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.DiagramToolTip; | |
22 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.NGC; | |
23 | import org.eclipse.linuxtools.tmf.ui.views.uml2sd.SDWidget; | |
24 | import org.eclipse.swt.SWT; | |
25 | import org.eclipse.swt.events.FocusEvent; | |
26 | import org.eclipse.swt.events.FocusListener; | |
27 | import org.eclipse.swt.events.KeyEvent; | |
28 | import org.eclipse.swt.events.ModifyEvent; | |
29 | import org.eclipse.swt.events.ModifyListener; | |
30 | import org.eclipse.swt.events.MouseEvent; | |
31 | import org.eclipse.swt.events.MouseTrackListener; | |
32 | import org.eclipse.swt.events.SelectionEvent; | |
33 | import org.eclipse.swt.events.SelectionListener; | |
34 | import org.eclipse.swt.events.TraverseEvent; | |
35 | import org.eclipse.swt.events.TraverseListener; | |
36 | import org.eclipse.swt.graphics.GC; | |
37 | import org.eclipse.swt.graphics.Image; | |
38 | import org.eclipse.swt.graphics.ImageData; | |
39 | import org.eclipse.swt.graphics.RGB; | |
40 | import org.eclipse.swt.graphics.Rectangle; | |
41 | import org.eclipse.swt.layout.GridData; | |
42 | import org.eclipse.swt.layout.GridLayout; | |
43 | import org.eclipse.swt.printing.PrintDialog; | |
44 | import org.eclipse.swt.printing.Printer; | |
45 | import org.eclipse.swt.printing.PrinterData; | |
46 | import org.eclipse.swt.widgets.Button; | |
47 | import org.eclipse.swt.widgets.Composite; | |
48 | import org.eclipse.swt.widgets.Control; | |
49 | import org.eclipse.swt.widgets.Display; | |
50 | import org.eclipse.swt.widgets.Group; | |
51 | import org.eclipse.swt.widgets.Label; | |
52 | import org.eclipse.swt.widgets.Shell; | |
53 | import org.eclipse.swt.widgets.Text; | |
54 | ||
55 | /** | |
56 | * @author sveyrier | |
57 | */ | |
58 | public class SDPrintDialogUI { | |
59 | ||
60 | protected Button setHPagesNumber; | |
61 | ||
62 | protected Button setVPagesNumber; | |
63 | ||
64 | protected Button useCurrentZoom; | |
65 | ||
66 | protected Button allPages; | |
67 | ||
68 | protected Button currentPage; | |
69 | ||
70 | protected Button pageList; | |
71 | ||
72 | protected Button pageRange; | |
73 | ||
74 | protected Text fromPage; | |
75 | ||
76 | protected Text toPage; | |
77 | ||
78 | protected SDWidget view; | |
79 | ||
80 | protected Text hPagesNum; | |
81 | ||
82 | protected Text vPagesNum; | |
83 | ||
84 | protected Text totalPages; | |
85 | ||
86 | protected ModifyListener modifyListener; | |
87 | ||
88 | protected SelectionListener selectionListener; | |
89 | ||
90 | protected LocalSD overviewCanvas; | |
91 | ||
92 | protected int nbPages = 0; | |
93 | ||
94 | protected int pageNum = -1; | |
95 | ||
96 | protected int firstPage = -1; | |
97 | ||
98 | protected int pagesList[]; | |
99 | ||
100 | protected float stepX, stepY, sTX, sTY; | |
101 | ||
102 | protected int from, to; | |
103 | ||
104 | protected boolean multiSelection = false; | |
105 | ||
106 | protected boolean areaSelection = false; | |
107 | ||
108 | protected boolean printAll; | |
109 | protected boolean printCurrent; | |
110 | protected boolean printSelection; | |
111 | protected boolean printRange; | |
112 | ||
113 | protected int nbRows, nbLines; | |
114 | ||
115 | protected float zoomFactor; | |
116 | ||
117 | protected PrinterData printerData; | |
118 | ||
119 | protected DiagramToolTip toolTip = null; | |
120 | ||
121 | protected Label currentSelection; | |
122 | ||
123 | protected Shell shell; | |
124 | ||
125 | protected Button printerDialog; | |
126 | ||
127 | protected boolean showPrintButton; | |
128 | ||
129 | int test = 3; | |
130 | ||
131 | public static int r = 0; | |
132 | ||
133 | // bug 195026 | |
134 | protected WizardPage parentWizardPage = null; | |
135 | protected SDPrintDialog parentDialog = null; | |
136 | ||
137 | protected class LocalSD extends SDWidget { | |
138 | ||
139 | @Override | |
140 | public int getContentsHeight() { | |
141 | if (view.getContentsHeight() > view.getContentsHeight()) | |
142 | return (int) (view.getVisibleHeight() / (float) test / view.zoomValue); | |
143 | else | |
144 | return (int) (super.getContentsHeight()); | |
145 | } | |
146 | ||
147 | @Override | |
148 | public int getContentsWidth() { | |
149 | if (view.getVisibleWidth() > view.getContentsWidth()) | |
150 | return (int) (view.getVisibleWidth() / (float) test / view.zoomValue); | |
151 | else | |
152 | return (int) (super.getContentsWidth()); | |
153 | } | |
154 | ||
155 | public LocalSD(Composite c, int s) { | |
156 | super(c, s); | |
157 | } | |
158 | ||
159 | @Override | |
160 | protected void contentsMouseHover(MouseEvent event) { | |
161 | } | |
162 | ||
163 | protected Image createPagesSelectionImages(Image img, int width, float stepX, int height, float stepY) { | |
164 | ||
165 | Image over = new Image(super.getShell().getDisplay(), img.getImageData()); | |
166 | ||
167 | for (int pageIndex = 0; pageIndex < pagesList.length; pageIndex++) { | |
168 | /* | |
169 | * int line=pageNum/getPagesForSelection(); int row=pageNum%getPagesForSelection(); if (row!=0) line++; | |
170 | * else row=getPagesForSelection(); line--; row--; over=new | |
171 | * Image(super.getShell().getDisplay(),drawRegionSelected(img,new Rectangle(row*stepX, | |
172 | * line*stepY,stepX,stepY),new RGB(0,155,0))); | |
173 | */ | |
174 | ||
175 | int pageNum = pagesList[pageIndex]; | |
176 | if (getPagesForSelection() > 0 && pageNum > 0) { | |
177 | int line = pageNum / getNbRow(); | |
178 | int row = pageNum % getNbRow(); | |
179 | if (row != 0) | |
180 | line++; | |
181 | else | |
182 | row = getNbRow(); | |
183 | ||
184 | line--; | |
185 | row--; | |
186 | ||
187 | Image toDel = over; | |
188 | if (overviewCanvas.isFocusControl()) | |
189 | over = new Image(super.getShell().getDisplay(), drawRegionSelected(toDel, new Rectangle(contentsToViewX((int) (row * stepX * overviewCanvas.zoomValue)), contentsToViewY((int) (line * stepY * overviewCanvas.zoomValue)), | |
190 | ((int) (stepX * overviewCanvas.zoomValue)), ((int) (stepY * overviewCanvas.zoomValue))), new RGB(0, 0, 128))); | |
191 | else | |
192 | over = new Image(super.getShell().getDisplay(), drawRegionSelected(toDel, new Rectangle(contentsToViewX((int) (row * stepX * overviewCanvas.zoomValue)), contentsToViewY((int) (line * stepY * overviewCanvas.zoomValue)), | |
193 | ((int) (stepX * overviewCanvas.zoomValue)), ((int) (stepY * overviewCanvas.zoomValue))), new RGB(221, 208, 200))); | |
194 | toDel.dispose(); | |
195 | } | |
196 | } | |
197 | ||
198 | Arrays.sort(pagesList); | |
199 | int pos = Arrays.binarySearch(pagesList, pageNum); | |
200 | if (pos < 0) | |
201 | if (getPagesForSelection() > 0 && pageNum > 0) { | |
202 | int line = pageNum / getNbRow(); | |
203 | int row = pageNum % getNbRow(); | |
204 | if (row != 0) | |
205 | line++; | |
206 | else | |
207 | row = getNbRow(); | |
208 | ||
209 | line--; | |
210 | row--; | |
211 | ||
212 | Image toDel = over; | |
213 | over = new Image(super.getShell().getDisplay(), drawRegionSelected(toDel, new Rectangle(contentsToViewX((int) (row * stepX * overviewCanvas.zoomValue)), contentsToViewY((int) (line * stepY * overviewCanvas.zoomValue)), | |
214 | ((int) (stepX * overviewCanvas.zoomValue)), ((int) (stepY * overviewCanvas.zoomValue))), new RGB(221, 208, 200))); | |
215 | toDel.dispose(); | |
216 | } | |
217 | ||
218 | GC imGC2 = new GC(over); | |
219 | imGC2.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK)); | |
220 | NGC imGC = new NGC(overviewCanvas, imGC2); | |
221 | for (int i = 0, x = 0; x <= width && stepX > 0; i++, x = (int) (i * stepX)) | |
222 | imGC.drawLine(x, 0, x, height); | |
223 | ||
224 | for (int j = 0, y = 0; y <= height && stepY > 0; j++, y = (int) (j * stepY)) | |
225 | imGC.drawLine(0, y, width, y); | |
226 | ||
227 | // imGC2.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE)); | |
228 | // // //imGC.drawLine(0, height, width, (int)(getVisibleHeight()/zoomValue)); | |
229 | // imGC.fillRectangle(0,height,(int)(getVisibleWidth()/zoomValue), | |
230 | // (int)(getVisibleHeight()/zoomValue)-height); | |
231 | ||
232 | imGC2.dispose(); | |
233 | imGC.dispose(); | |
234 | return over; | |
235 | } | |
236 | ||
237 | @Override | |
238 | protected void drawContents(GC gc, int clipx, int clipy, int clipw, int cliph) { | |
239 | ||
240 | Image dbuffer = getDrawBuffer(gc); | |
241 | computeStepXY(); | |
242 | Image d; | |
243 | ||
244 | int lw = (int) (getContentsWidth() / zoomValue); | |
245 | if (getContentsWidth() < getVisibleWidth()) | |
246 | lw = (int) (getVisibleWidth() / zoomValue); | |
247 | ||
248 | int lh = (int) (getContentsHeight() / zoomValue); | |
249 | if (getContentsHeight() < getVisibleHeight()) | |
250 | lh = (int) (getVisibleHeight() / zoomValue); | |
251 | d = createPagesSelectionImages(dbuffer, lw, stepX, lh, stepY); | |
252 | ||
253 | if (!isEnabled()) { | |
254 | Image toDel = d; | |
255 | d = new Image(super.getShell().getDisplay(), drawRegionSelected(d, new Rectangle(0, 0, lw, lh), new RGB(221, 208, 200))); | |
256 | // d, new Rectangle(0,0,((int)(stepX*overviewCanvas.zoomValue)),((int)( | |
257 | // stepY*overviewCanvas.zoomValue))),new RGB(221,208,200))); | |
258 | toDel.dispose(); | |
259 | } | |
260 | ||
261 | Rectangle area = getClientArea(); | |
262 | int w = d.getBounds().width; | |
263 | int h = d.getBounds().height; | |
264 | gc.drawImage(d, 0, 0, w, h, 0, 0, area.width, area.height); | |
265 | ||
266 | totalPages.setText(Integer.valueOf(maxNumOfPages()).toString()); | |
267 | displayPageNum(); | |
268 | dbuffer.dispose(); | |
269 | d.dispose(); | |
270 | gc.dispose(); | |
271 | ||
272 | } | |
273 | ||
274 | @Override | |
275 | protected void keyPressedEvent(KeyEvent e) { | |
276 | if (e.keyCode == SWT.CTRL) | |
277 | multiSelection = true; | |
278 | if (e.keyCode == SWT.SHIFT) | |
279 | areaSelection = true; | |
280 | if (e.keyCode == SWT.ARROW_DOWN) { | |
281 | if (pageNum + getNbRow() <= maxNumOfPages()) | |
282 | pageNum += getNbRow(); | |
283 | int line = pageNum / getNbRow(); | |
284 | int row = pageNum % getNbRow(); | |
285 | if (row == 0) | |
286 | line--; | |
287 | if ((line + 1) * stepY > (overviewCanvas.getContentsY() + overviewCanvas.getVisibleHeight()) / overviewCanvas.zoomValue) | |
288 | overviewCanvas.scrollBy(0, (int) (stepY * overviewCanvas.zoomValue)); | |
289 | } | |
290 | if (e.keyCode == SWT.ARROW_UP) { | |
291 | if (pageNum - getNbRow() > 0) | |
292 | pageNum -= getNbRow(); | |
293 | int line = pageNum / getNbRow(); | |
294 | int row = pageNum % getNbRow(); | |
295 | if (row == 0) | |
296 | line--; | |
297 | if ((line) * stepY <= overviewCanvas.getContentsY() / overviewCanvas.zoomValue) | |
298 | overviewCanvas.scrollBy(0, -(int) (stepY * overviewCanvas.zoomValue)); | |
299 | } | |
300 | if (e.keyCode == SWT.ARROW_LEFT) { | |
301 | if ((pageNum - 2) / getNbRow() == (pageNum - 1) / getNbRow() && pageNum > 1) | |
302 | pageNum--; | |
303 | int row = pageNum % getNbRow(); | |
304 | if ((row - 1) * stepX < (overviewCanvas.getContentsX()) / overviewCanvas.zoomValue) | |
305 | overviewCanvas.scrollBy(-(int) (stepX * overviewCanvas.zoomValue), 0); | |
306 | } | |
307 | if (e.keyCode == SWT.ARROW_RIGHT) { | |
308 | if ((pageNum - 1) / getNbRow() == pageNum / getNbRow()) | |
309 | pageNum++; | |
310 | int row = pageNum % getNbRow(); | |
311 | if (row == 0) | |
312 | row = getNbRow(); | |
313 | if ((row) * stepX > (overviewCanvas.getContentsX() + overviewCanvas.getVisibleWidth()) / overviewCanvas.zoomValue) | |
314 | overviewCanvas.scrollBy((int) (stepX * overviewCanvas.zoomValue), 0); | |
315 | } | |
316 | ||
317 | if (e.keyCode == 32 && pageNum > -1) { | |
318 | Arrays.sort(pagesList); | |
319 | int pos = Arrays.binarySearch(pagesList, pageNum); | |
320 | if (pos < 0) | |
321 | addToPagesList(pageNum); | |
322 | else | |
323 | removeFromPagesList(pageNum); | |
324 | } | |
325 | ||
326 | if (!areaSelection && !multiSelection) { | |
327 | firstPage = pageNum; | |
328 | pagesList = new int[1]; | |
329 | pagesList[0] = pageNum; | |
330 | } else if ((pageNum != -1) && (areaSelection) && (firstPage != -1)) { | |
331 | pagesList = new int[0]; | |
332 | int line1 = firstPage / getNbRow(); | |
333 | int row1 = firstPage % getNbRow(); | |
334 | if (row1 != 0) | |
335 | line1++; | |
336 | else | |
337 | row1 = getNbRow(); | |
338 | ||
339 | int line2 = pageNum / getNbRow(); | |
340 | int row2 = pageNum % getNbRow(); | |
341 | if (row2 != 0) | |
342 | line2++; | |
343 | else | |
344 | row2 = getNbRow(); | |
345 | ||
346 | int temp; | |
347 | if (line1 > line2) { | |
348 | temp = line2; | |
349 | line2 = line1; | |
350 | line1 = temp; | |
351 | } | |
352 | ||
353 | if (row1 > row2) { | |
354 | temp = row2; | |
355 | row2 = row1; | |
356 | row1 = temp; | |
357 | } | |
358 | ||
359 | for (int i = row1 - 1; i < row2; i++) | |
360 | for (int j = line1 - 1; j < line2; j++) | |
361 | addToPagesList(i + j * getNbRow() + 1); | |
362 | ||
363 | } | |
364 | displayPageNum(); | |
365 | overviewCanvas.redraw(); | |
366 | } | |
367 | ||
368 | @Override | |
369 | protected void keyReleasedEvent(KeyEvent e) { | |
370 | if (e.keyCode == SWT.CTRL) | |
371 | multiSelection = false; | |
372 | if (e.keyCode == SWT.SHIFT) | |
373 | areaSelection = false; | |
374 | } | |
375 | ||
376 | @Override | |
377 | protected void contentsMouseDownEvent(MouseEvent event) { | |
378 | ||
379 | computeStepXY(); | |
380 | int x1 = (int) ((event.x / overviewCanvas.zoomValue) / stepX); | |
381 | int x2 = (int) ((event.y / overviewCanvas.zoomValue) / stepY); | |
382 | ||
383 | int oldPage = pageNum; | |
384 | ||
385 | pageNum = x1 + x2 * getNbRow() + 1; | |
386 | ||
387 | if (pageNum > maxNumOfPages()) { | |
388 | pageNum = oldPage; | |
389 | return; | |
390 | } | |
391 | ||
392 | if (!areaSelection) | |
393 | firstPage = pageNum; | |
394 | ||
395 | if ((pageNum != -1) && (multiSelection)) { | |
396 | Arrays.sort(pagesList); | |
397 | int pos = Arrays.binarySearch(pagesList, pageNum); | |
398 | if (pos < 0) | |
399 | addToPagesList(pageNum); | |
400 | else | |
401 | removeFromPagesList(pageNum); | |
402 | } else if ((pageNum != -1) && (areaSelection) && (firstPage != -1)) { | |
403 | ||
404 | pagesList = new int[0]; | |
405 | ||
406 | int line1 = firstPage / getNbRow(); | |
407 | int row1 = firstPage % getNbRow(); | |
408 | if (row1 != 0) | |
409 | line1++; | |
410 | else | |
411 | row1 = getNbRow(); | |
412 | ||
413 | int line2 = pageNum / getNbRow(); | |
414 | int row2 = pageNum % getNbRow(); | |
415 | if (row2 != 0) | |
416 | line2++; | |
417 | else | |
418 | row2 = getNbRow(); | |
419 | ||
420 | int temp; | |
421 | if (line1 > line2) { | |
422 | temp = line2; | |
423 | line2 = line1; | |
424 | line1 = temp; | |
425 | } | |
426 | ||
427 | if (row1 > row2) { | |
428 | temp = row2; | |
429 | row2 = row1; | |
430 | row1 = temp; | |
431 | } | |
432 | ||
433 | for (int i = row1 - 1; i < row2; i++) | |
434 | for (int j = line1 - 1; j < line2; j++) | |
435 | addToPagesList(i + j * getNbRow() + 1); | |
436 | } else { | |
437 | pagesList = new int[1]; | |
438 | pagesList[0] = pageNum; | |
439 | } | |
440 | if ((event.stateMask & SWT.CTRL) != 0) | |
441 | multiSelection = true; | |
442 | displayPageNum(); | |
443 | redraw(); | |
444 | } | |
445 | ||
446 | @Override | |
447 | protected void contentsMouseMoveEvent(MouseEvent e) { | |
448 | toolTip.hideToolTip(); | |
449 | } | |
450 | ||
451 | @Override | |
452 | public void resizeContents(int _w, int _h) { | |
453 | // if (r<2) | |
454 | super.resizeContents(_w, _h); | |
455 | r++; | |
456 | } | |
457 | ||
458 | } | |
459 | ||
460 | public SDPrintDialogUI(Shell s, SDWidget v) { | |
461 | ||
462 | this(s, v, false); | |
463 | ||
464 | } | |
465 | ||
466 | public SDPrintDialogUI(Shell s, SDWidget v, boolean showPrintBtn) { | |
467 | ||
468 | setShell(s); | |
469 | view = v; | |
470 | showPrintButton = showPrintBtn; | |
471 | ||
472 | printerData = Printer.getDefaultPrinterData(); | |
473 | if (printerData != null) { | |
474 | printerData.scope = PrinterData.SELECTION; | |
475 | } | |
476 | ||
477 | pagesList = new int[0]; | |
478 | ||
479 | selectionListener = new SelectionListener() { | |
480 | ||
481 | @Override | |
482 | public void widgetSelected(SelectionEvent e) { | |
483 | if (useCurrentZoom.getSelection()) { | |
484 | hPagesNum.setEnabled(false); | |
485 | vPagesNum.setEnabled(false); | |
486 | } | |
487 | if (setHPagesNumber.getSelection()) { | |
488 | hPagesNum.setEnabled(true); | |
489 | vPagesNum.setEnabled(false); | |
490 | if (currentPage.getSelection()) { | |
491 | currentPage.setSelection(false); | |
492 | allPages.setSelection(true); | |
493 | } | |
494 | if (hPagesNum.getText() == "") //$NON-NLS-1$ | |
495 | hPagesNum.setText("1"); //$NON-NLS-1$ | |
496 | } | |
497 | if (setVPagesNumber.getSelection()) { | |
498 | hPagesNum.setEnabled(false); | |
499 | vPagesNum.setEnabled(true); | |
500 | if (currentPage.getSelection()) { | |
501 | currentPage.setSelection(false); | |
502 | allPages.setSelection(true); | |
503 | } | |
504 | if (vPagesNum.getText() == "") //$NON-NLS-1$ | |
505 | vPagesNum.setText("1"); //$NON-NLS-1$ | |
506 | } | |
507 | if (currentPage.getSelection() || allPages.getSelection() || pageList.getSelection()) { | |
508 | fromPage.setEnabled(false); | |
509 | toPage.setEnabled(false); | |
510 | } else { | |
511 | fromPage.setEnabled(true); | |
512 | toPage.setEnabled(true); | |
513 | } | |
514 | ||
515 | currentPage.setEnabled(useCurrentZoom.getSelection()); | |
516 | overviewCanvas.setEnabled(pageList.getSelection()); | |
517 | if (overviewCanvas.isEnabled() && (e.widget == useCurrentZoom || e.widget == setHPagesNumber || e.widget == setVPagesNumber)) { | |
518 | pagesList = new int[1]; | |
519 | pagesList[0] = 1; | |
520 | pageNum = 1; | |
521 | firstPage = 1; | |
522 | } else if (overviewCanvas.isEnabled() && (e.widget == pageList)) { | |
523 | if (pagesList == null || pagesList.length <= 0) { | |
524 | pagesList = new int[1]; | |
525 | pagesList[0] = 1; | |
526 | pageNum = 1; | |
527 | firstPage = 1; | |
528 | } | |
529 | } | |
530 | computeStepXY(); | |
531 | totalPages.setText(Integer.valueOf(maxNumOfPages()).toString()); | |
532 | overviewCanvas.redraw(); | |
533 | overviewCanvas.update(); | |
534 | } | |
535 | ||
536 | @Override | |
537 | public void widgetDefaultSelected(SelectionEvent e) { | |
538 | pagesList = new int[0]; | |
539 | computeStepXY(); | |
540 | overviewCanvas.redraw(); | |
541 | } | |
542 | ||
543 | }; | |
544 | ||
545 | modifyListener = new ModifyListener() { | |
546 | ||
547 | @Override | |
548 | public void modifyText(ModifyEvent e) { | |
549 | pagesList = new int[0]; | |
550 | computeStepXY(); | |
551 | totalPages.setText(Integer.valueOf(maxNumOfPages()).toString()); | |
552 | overviewCanvas.redraw(); | |
553 | } | |
554 | ||
555 | }; | |
556 | } | |
557 | ||
558 | protected GridData newGridData(int span) { | |
559 | GridData data = new GridData(GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL); | |
560 | data.horizontalSpan = span; | |
561 | return data; | |
562 | } | |
563 | ||
564 | public Control createDialogArea(Composite parent) { | |
565 | ||
566 | GridLayout parentLayout = new GridLayout(); | |
567 | parentLayout.numColumns = 6; | |
568 | parent.setLayout(parentLayout); | |
569 | ||
570 | Group g1 = new Group(parent, SWT.SHADOW_NONE); | |
571 | g1.setText(SDMessages._113); | |
572 | g1.setLayoutData(newGridData(3)); | |
573 | GridLayout g1layout = new GridLayout(); | |
574 | g1layout.numColumns = 2; | |
575 | g1.setLayout(g1layout); | |
576 | ||
577 | useCurrentZoom = new Button(g1, SWT.RADIO); | |
578 | useCurrentZoom.setText(SDMessages._112); | |
579 | useCurrentZoom.setLayoutData(newGridData(2)); | |
580 | useCurrentZoom.addSelectionListener(selectionListener); | |
581 | ||
582 | setHPagesNumber = new Button(g1, SWT.RADIO); | |
583 | setHPagesNumber.setText(SDMessages._110); | |
584 | setHPagesNumber.setLayoutData(newGridData(1)); | |
585 | setHPagesNumber.addSelectionListener(selectionListener); | |
586 | ||
587 | hPagesNum = new Text(g1, SWT.SINGLE | SWT.BORDER); | |
588 | hPagesNum.addModifyListener(modifyListener); | |
589 | ||
590 | setVPagesNumber = new Button(g1, SWT.RADIO); | |
591 | setVPagesNumber.setText(SDMessages._111); | |
592 | setVPagesNumber.setLayoutData(newGridData(1)); | |
593 | setVPagesNumber.addSelectionListener(selectionListener); | |
594 | ||
595 | vPagesNum = new Text(g1, SWT.SINGLE | SWT.BORDER); | |
596 | vPagesNum.addModifyListener(modifyListener); | |
597 | ||
598 | Label nbTotal = new Label(g1, SWT.SHADOW_NONE | SWT.RIGHT); | |
599 | nbTotal.setText(SDMessages._109); | |
600 | // nbTotal.setLayoutData(newGridData(1)); | |
601 | ||
602 | totalPages = new Text(g1, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY); | |
603 | // nbHV.addModifyListener(modifListener); | |
604 | ||
605 | Group g2 = new Group(parent, SWT.SHADOW_NONE); | |
606 | g2.setText(SDMessages._119); | |
607 | GridData data = new GridData(GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL); | |
608 | data.horizontalSpan = 3; | |
609 | data.verticalSpan = 2; | |
610 | g2.setLayoutData(data); | |
611 | GridLayout g2layout = new GridLayout(); | |
612 | // g2layout. | |
613 | g2layout.numColumns = 1; | |
614 | // SVLayout g2layout = new SVLayout(); | |
615 | g2.setLayout(g2layout); | |
616 | ||
617 | GridData data2 = new GridData(GridData.GRAB_VERTICAL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL); | |
618 | data2.horizontalSpan = 1; | |
619 | data2.verticalSpan = 1; | |
620 | ||
621 | overviewCanvas = new LocalSD(g2, SWT.NO_BACKGROUND); | |
622 | GridData seqDiagLayoutData = new GridData(GridData.HORIZONTAL_ALIGN_FILL// |GridData.GRAB_HORIZONTAL| | |
623 | /* GridData.GRAB_VERTICAL| */| GridData.VERTICAL_ALIGN_FILL); | |
624 | // seqDiagLayoutData.widthHint=400; | |
625 | // seqDiagLayoutData.horizontalAlignment=GridData.HORIZONTAL_ALIGN_FILL; | |
626 | overviewCanvas.setLayoutData(seqDiagLayoutData); | |
627 | // overviewCanvas.resizeContents(100,100); | |
628 | if (view.getContentsWidth() < view.getVisibleWidth() && view.getContentsHeight() < view.getVisibleHeight()) | |
629 | test = 3; | |
630 | else | |
631 | test = 10; | |
632 | overviewCanvas.setFrame(view.getFrame(), true); | |
633 | overviewCanvas.zoomValue = (float) 1 / test; | |
634 | overviewCanvas.setCornerControl(null); | |
635 | seqDiagLayoutData.widthHint = overviewCanvas.getContentsWidth() / test; | |
636 | seqDiagLayoutData.widthHint = overviewCanvas.getFrame().getWidth() / test + 15; | |
637 | ||
638 | if (view.getVisibleWidth() < view.getContentsWidth()) { | |
639 | seqDiagLayoutData.widthHint = overviewCanvas.getContentsWidth() / test; | |
640 | if (seqDiagLayoutData.widthHint > Display.getDefault().getClientArea().width / 4) | |
641 | seqDiagLayoutData.widthHint = Display.getDefault().getClientArea().width / 4; | |
642 | } else | |
643 | seqDiagLayoutData.widthHint = overviewCanvas.getFrame().getWidth() / test + 15; | |
644 | ||
645 | if (view.getVisibleHeight() < view.getContentsHeight()) { | |
646 | seqDiagLayoutData.heightHint = overviewCanvas.getContentsHeight() / test; | |
647 | if (seqDiagLayoutData.heightHint > Display.getDefault().getClientArea().width / 4) | |
648 | seqDiagLayoutData.heightHint = Display.getDefault().getClientArea().width / 4; | |
649 | } else | |
650 | seqDiagLayoutData.heightHint = overviewCanvas.getFrame().getHeight() / test; | |
651 | ||
652 | overviewCanvas.setEnabled(false); | |
653 | ||
654 | currentSelection = new Label(g2, SWT.SHADOW_NONE | SWT.LEFT); | |
655 | currentSelection.setLayoutData(newGridData(1)); | |
656 | ||
657 | Group g3 = new Group(parent, SWT.SHADOW_NONE); | |
658 | g3.setText(SDMessages._118); | |
659 | g3.setLayoutData(newGridData(3)); | |
660 | GridLayout g3layout = new GridLayout(); | |
661 | g3layout.numColumns = 4; | |
662 | g3.setLayout(g3layout); | |
663 | ||
664 | allPages = new Button(g3, SWT.RADIO); | |
665 | allPages.setText(SDMessages._108); | |
666 | allPages.setLayoutData(newGridData(4)); | |
667 | allPages.addSelectionListener(selectionListener); | |
668 | ||
669 | currentPage = new Button(g3, SWT.RADIO); | |
670 | currentPage.setText(SDMessages._107); | |
671 | currentPage.setLayoutData(newGridData(4)); | |
672 | currentPage.setEnabled(true); | |
673 | currentPage.setSelection(true); | |
674 | currentPage.addSelectionListener(selectionListener); | |
675 | ||
676 | pageList = new Button(g3, SWT.RADIO); | |
677 | pageList.setText(SDMessages._106); | |
678 | pageList.setLayoutData(newGridData(4)); | |
679 | pageList.addSelectionListener(selectionListener); | |
680 | ||
681 | pageRange = new Button(g3, SWT.RADIO); | |
682 | pageRange.setText(SDMessages._103); | |
683 | pageRange.setLayoutData(newGridData(1)); | |
684 | pageRange.addSelectionListener(selectionListener); | |
685 | ||
686 | fromPage = new Text(g3, SWT.SINGLE | SWT.BORDER); | |
687 | ||
688 | Label labelTo = new Label(g3, SWT.CENTER); | |
689 | labelTo.setText(SDMessages._105); | |
690 | ||
691 | toPage = new Text(g3, SWT.SINGLE | SWT.BORDER); | |
692 | ||
693 | toolTip = new DiagramToolTip(overviewCanvas); | |
694 | ||
695 | overviewCanvas.getViewControl().addMouseTrackListener(new MouseTrackListener() { | |
696 | ||
697 | @Override | |
698 | public void mouseEnter(MouseEvent e) { | |
699 | toolTip.hideToolTip(); | |
700 | } | |
701 | ||
702 | @Override | |
703 | public void mouseExit(MouseEvent e) { | |
704 | toolTip.hideToolTip(); | |
705 | } | |
706 | ||
707 | @Override | |
708 | public void mouseHover(MouseEvent e) { | |
709 | int x1 = (int) (overviewCanvas.viewToContentsX(e.x) / overviewCanvas.zoomValue / stepX); | |
710 | int x2 = (int) (overviewCanvas.viewToContentsY(e.y) / overviewCanvas.zoomValue / stepY); | |
711 | int num = x1 + x2 * getNbRow() + 1; | |
712 | if (num > maxNumOfPages()) | |
713 | return; | |
714 | if (num > 0) { | |
715 | toolTip.showToolTip(String.valueOf(num)); | |
716 | displayPageNum(); | |
717 | } else { | |
718 | currentSelection.setText("");//$NON-NLS-1$ | |
719 | toolTip.hideToolTip(); | |
720 | } | |
721 | } | |
722 | ||
723 | }); | |
724 | ||
725 | overviewCanvas.addTraverseListener(new TraverseListener() { | |
726 | ||
727 | @Override | |
728 | public void keyTraversed(TraverseEvent e) { | |
729 | if ((e.detail == SWT.TRAVERSE_TAB_NEXT) || (e.detail == SWT.TRAVERSE_TAB_PREVIOUS)) | |
730 | e.doit = true; | |
731 | } | |
732 | ||
733 | }); | |
734 | ||
735 | overviewCanvas.addFocusListener(new FocusListener() { | |
736 | ||
737 | @Override | |
738 | public void focusGained(FocusEvent e) { | |
739 | overviewCanvas.redraw(); | |
740 | } | |
741 | ||
742 | @Override | |
743 | public void focusLost(FocusEvent e) { | |
744 | overviewCanvas.redraw(); | |
745 | } | |
746 | }); | |
747 | ||
748 | if (showPrintButton) { | |
749 | Composite printerDlg = new Composite(parent, SWT.NONE); | |
750 | data = GridUtil.createHorizontalFill(); | |
751 | data.horizontalSpan = 6; | |
752 | parentLayout = new GridLayout(); | |
753 | parentLayout.numColumns = 2; | |
754 | printerDlg.setLayout(parentLayout); | |
755 | printerDlg.setLayoutData(data); | |
756 | ||
757 | Label label = new Label(printerDlg, SWT.NONE); | |
758 | label.setLayoutData(GridUtil.createHorizontalFill()); | |
759 | printerDialog = new Button(printerDlg, SWT.PUSH); | |
760 | printerDialog.setText(SDMessages._115); | |
761 | ||
762 | printerDialog.addSelectionListener(new SelectionListener() { | |
763 | ||
764 | @Override | |
765 | public void widgetSelected(SelectionEvent e) { | |
766 | ||
767 | printButtonSelected(); | |
768 | } | |
769 | ||
770 | @Override | |
771 | public void widgetDefaultSelected(SelectionEvent e) { | |
772 | } | |
773 | ||
774 | }); | |
775 | } | |
776 | ||
777 | updatePrinterStatus(); | |
778 | ||
779 | return parent; | |
780 | } | |
781 | ||
782 | public int getPagesForSelection() { | |
783 | return nbPages; | |
784 | } | |
785 | ||
786 | public boolean okPressed() { | |
787 | printAll = allPages.getSelection(); | |
788 | printCurrent = currentPage.getSelection(); | |
789 | printSelection = pageList.getSelection(); | |
790 | printRange = pageRange.getSelection(); | |
791 | try { | |
792 | if (printRange) { | |
793 | from = Integer.valueOf(fromPage.getText()).intValue(); | |
794 | to = Integer.valueOf(toPage.getText()).intValue(); | |
795 | if (from > maxNumOfPages() || to > maxNumOfPages() || from <= 0 || to <= 0) { | |
796 | MessageDialog.openError(getShell(), SDMessages._98, SDMessages._99); | |
797 | return false; | |
798 | } | |
799 | } else if (setHPagesNumber.getSelection() && nbPages <= 0) { | |
800 | MessageDialog.openError(getShell(), SDMessages._98, SDMessages._101); | |
801 | return false; | |
802 | } else if (setVPagesNumber.getSelection() && nbPages <= 0) { | |
803 | MessageDialog.openError(getShell(), SDMessages._98, SDMessages._100); | |
804 | return false; | |
805 | } else if (printSelection && getPageList().length <= 0) { | |
806 | MessageDialog.openError(getShell(), SDMessages._98, SDMessages._102); | |
807 | return false; | |
808 | } | |
809 | ||
810 | } catch (Exception e) { | |
811 | MessageDialog.openError(getShell(), SDMessages._98, SDMessages._99); | |
812 | from = 0; | |
813 | to = 0; | |
814 | return false; | |
815 | } | |
816 | ||
817 | return true; | |
818 | } | |
819 | ||
820 | public ImageData drawRegionSelected(Image img, Rectangle r, RGB color) { | |
821 | ImageData id = img.getImageData(); | |
822 | for (int a = 0; a < r.width && r.x + a < id.width; a++) { | |
823 | for (int b = 0; b < r.height && r.y + b < id.height; b++) { | |
824 | int index = id.getPixel(r.x + a, r.y + b); | |
825 | RGB rgb = id.palette.getRGB(index); | |
826 | rgb = combine(color, rgb); | |
827 | id.setPixel(r.x + a, r.y + b, id.palette.getPixel(rgb)); | |
828 | } | |
829 | } | |
830 | return id; | |
831 | } | |
832 | ||
833 | public static RGB combine(RGB front, RGB back) { | |
834 | int _af = 128; | |
835 | if (_af == 1) | |
836 | return front; | |
837 | if (_af == 0) | |
838 | return back; | |
839 | int _ab = 200; | |
840 | if (_ab == 0) | |
841 | return front; | |
842 | ||
843 | double af = (_af) / 255.0; | |
844 | double rf = front.red; | |
845 | double gf = front.green; | |
846 | double bf = front.blue; | |
847 | ||
848 | double ab = (_ab) / 255.0; | |
849 | double rb = back.red; | |
850 | double gb = back.green; | |
851 | double bb = back.blue; | |
852 | ||
853 | double k = (1.0 - af) * ab; | |
854 | int r = (int) ((af * rf + k * rb)); | |
855 | int g = (int) ((af * gf + k * gb)); | |
856 | int b = (int) ((af * bf + k * bb)); | |
857 | ||
858 | return new RGB(r, g, b); | |
859 | } | |
860 | ||
861 | protected void computeStepXY() { | |
862 | float cw = overviewCanvas.getContentsWidth() / overviewCanvas.zoomValue; | |
863 | float ch = overviewCanvas.getContentsHeight() / overviewCanvas.zoomValue; | |
864 | try { | |
865 | if (printerData == null) { | |
866 | stepX = 0; | |
867 | stepY = 0; | |
868 | nbPages = 0; | |
869 | zoomFactor = 0; | |
870 | } else { | |
871 | Printer printer = new Printer(printerData); | |
872 | if (setHPagesNumber.getSelection()) { | |
873 | nbPages = Integer.valueOf(hPagesNum.getText()).intValue(); | |
874 | float z1 = (float) view.getContentsWidth() / (cw); | |
875 | float z2 = printer.getClientArea().width / ((float) view.getContentsWidth() / nbPages); | |
876 | ||
877 | stepY = printer.getClientArea().height / z1 / z2; | |
878 | stepX = cw / nbPages; | |
879 | } else if (setVPagesNumber.getSelection()) { | |
880 | nbPages = Integer.valueOf(vPagesNum.getText()).intValue(); | |
881 | float z1 = (float) view.getContentsHeight() / (ch); | |
882 | float z2 = printer.getClientArea().height / ((float) view.getContentsHeight() / nbPages); | |
883 | stepX = printer.getClientArea().width / z1 / z2; | |
884 | stepY = ch / nbPages; | |
885 | } else { | |
886 | float z1 = view.getContentsWidth() / (cw); | |
887 | stepX = ((float) view.getVisibleWidth() / z1); | |
888 | nbPages = Math.round(cw / stepX); | |
889 | if (nbPages == 0) | |
890 | nbPages = 1; | |
891 | int pw = printer.getClientArea().width; | |
892 | int ph = printer.getClientArea().height; | |
893 | float z2 = pw / ((float) view.getContentsWidth() / nbPages); | |
894 | stepY = ((float) ph / z1 / z2); | |
895 | } | |
896 | } | |
897 | } finally { | |
898 | stepX = stepY = nbPages = 0; | |
899 | zoomFactor = 0; | |
900 | } | |
901 | sTX = stepX * (view.getContentsWidth() / cw); | |
902 | sTY = stepY * (view.getContentsHeight() / ch); | |
903 | float rat = 1; | |
904 | if ((view.getVisibleWidth() > view.getContentsWidth()) && (setVPagesNumber.getSelection() || setHPagesNumber.getSelection())) | |
905 | rat = (float) view.getVisibleWidth() / (float) view.getContentsWidth(); | |
906 | zoomFactor = (overviewCanvas.getContentsWidth() / cw) / overviewCanvas.getZoomFactor() * rat;// /view.getZoomFactor(); | |
907 | } | |
908 | ||
909 | public int[] getPageList() { | |
910 | return pagesList; | |
911 | } | |
912 | ||
913 | public void addToPagesList(int num) { | |
914 | int temp[] = new int[pagesList.length + 1]; | |
915 | System.arraycopy(pagesList, 0, temp, 0, pagesList.length); | |
916 | temp[temp.length - 1] = num; | |
917 | pagesList = new int[temp.length]; | |
918 | System.arraycopy(temp, 0, pagesList, 0, temp.length); | |
919 | } | |
920 | ||
921 | public void removeFromPagesList(int num) { | |
922 | int pos = Arrays.binarySearch(pagesList, num); | |
923 | int temp[] = new int[pagesList.length - 1]; | |
924 | System.arraycopy(pagesList, 0, temp, 0, pos); | |
925 | System.arraycopy(pagesList, pos + 1, temp, pos, pagesList.length - pos - 1); | |
926 | pagesList = new int[temp.length]; | |
927 | System.arraycopy(temp, 0, pagesList, 0, temp.length); | |
928 | } | |
929 | ||
930 | public int maxNumOfPages() { | |
931 | int max = getNbRow() * getNbLines(); | |
932 | return max; | |
933 | } | |
934 | ||
935 | public int getNbRow() { | |
936 | if (!setHPagesNumber.isDisposed()) { | |
937 | int cw = (int) (overviewCanvas.getContentsWidth() / overviewCanvas.zoomValue); | |
938 | if (stepX == 0) | |
939 | return 1; | |
940 | int row = (int) (cw / stepX); | |
941 | if (setHPagesNumber.getSelection()) | |
942 | row = Math.round((float) cw / stepX); | |
943 | else if ((cw % stepX != 0)) | |
944 | row++; | |
945 | ||
946 | nbRows = row; | |
947 | } | |
948 | return nbRows; | |
949 | } | |
950 | ||
951 | public int getNbLines() { | |
952 | if (!setVPagesNumber.isDisposed()) { | |
953 | int ch = (int) (overviewCanvas.getContentsHeight() / overviewCanvas.zoomValue); | |
954 | if (stepY == 0) | |
955 | return 1; | |
956 | int line = (int) (ch / stepY); | |
957 | if (setVPagesNumber.getSelection()) | |
958 | line = Math.round((float) ch / stepY); | |
959 | else if (ch % stepY != 0) | |
960 | line++; | |
961 | nbLines = line; | |
962 | } | |
963 | return nbLines; | |
964 | } | |
965 | ||
966 | public boolean printAll() { | |
967 | return printAll; | |
968 | } | |
969 | ||
970 | public boolean printCurrent() { | |
971 | return printCurrent; | |
972 | } | |
973 | ||
974 | public boolean printSelection() { | |
975 | return printSelection; | |
976 | } | |
977 | ||
978 | public boolean printRange() { | |
979 | return printRange; | |
980 | } | |
981 | ||
982 | public float getStepX() { | |
983 | return sTX; | |
984 | } | |
985 | ||
986 | public float getStepY() { | |
987 | return sTY; | |
988 | } | |
989 | ||
990 | public float getZoomFactor() { | |
991 | return zoomFactor; | |
992 | } | |
993 | ||
994 | // public abstract void createButtonsForButtonBar(Composite parent); | |
995 | ||
996 | public PrinterData getPrinterData() { | |
997 | return printerData; | |
998 | } | |
999 | ||
1000 | public int getFrom() { | |
1001 | return from; | |
1002 | } | |
1003 | ||
1004 | public int getTo() { | |
1005 | return to; | |
1006 | } | |
1007 | ||
1008 | protected void displayPageNum() { | |
1009 | if (pageNum > 0) { | |
1010 | String message = MessageFormat.format(SDMessages._117, new Object[] { Integer.valueOf(pageNum) }); | |
1011 | currentSelection.setText(message); | |
1012 | currentSelection.getParent().layout(); | |
1013 | } | |
1014 | } | |
1015 | ||
1016 | public Shell getShell() { | |
1017 | return shell; | |
1018 | } | |
1019 | ||
1020 | public void setShell(Shell shell) { | |
1021 | this.shell = shell; | |
1022 | } | |
1023 | ||
1024 | public void printButtonSelected() { | |
1025 | PrintDialog printer = new PrintDialog(getShell()); | |
1026 | if (allPages.getSelection()) | |
1027 | printer.setScope(PrinterData.ALL_PAGES); | |
1028 | if (currentPage.getSelection()) | |
1029 | printer.setScope(PrinterData.SELECTION); | |
1030 | if (pageList.getSelection()) | |
1031 | printer.setScope(PrinterData.SELECTION); | |
1032 | if (pageRange.getSelection()) { | |
1033 | printer.setScope(PrinterData.PAGE_RANGE); | |
1034 | from = Integer.valueOf(fromPage.getText()).intValue(); | |
1035 | to = Integer.valueOf(toPage.getText()).intValue(); | |
1036 | printer.setStartPage(from); | |
1037 | printer.setEndPage(to); | |
1038 | } | |
1039 | ||
1040 | PrinterData newPrinterData = printer.open(); | |
1041 | if (newPrinterData != null) { | |
1042 | printerData = newPrinterData; | |
1043 | } | |
1044 | updatePrinterStatus(); | |
1045 | ||
1046 | if (printer.getScope() == PrinterData.ALL_PAGES) { | |
1047 | allPages.setSelection(true); | |
1048 | currentPage.setSelection(false); | |
1049 | pageList.setSelection(false); | |
1050 | pageRange.setSelection(false); | |
1051 | hPagesNum.setEnabled(false); | |
1052 | vPagesNum.setEnabled(false); | |
1053 | } | |
1054 | if (printer.getScope() == PrinterData.PAGE_RANGE) { | |
1055 | allPages.setSelection(false); | |
1056 | currentPage.setSelection(false); | |
1057 | pageList.setSelection(false); | |
1058 | pageRange.setSelection(true); | |
1059 | fromPage.setEnabled(true); | |
1060 | toPage.setEnabled(true); | |
1061 | fromPage.setText((Integer.valueOf(printer.getStartPage())).toString()); | |
1062 | toPage.setText((Integer.valueOf(printer.getEndPage())).toString()); | |
1063 | } | |
1064 | computeStepXY(); | |
1065 | overviewCanvas.redraw(); | |
1066 | } | |
1067 | ||
1068 | public void setParentWizardPage(WizardPage parent) { | |
1069 | parentWizardPage = parent; | |
1070 | } | |
1071 | ||
1072 | public void setParentDialog(SDPrintDialog parent) { | |
1073 | parentDialog = parent; | |
1074 | } | |
1075 | ||
1076 | protected void updatePrinterStatus() { | |
1077 | if (parentWizardPage != null) { | |
1078 | // used in the wizard dialog | |
1079 | if (printerData == null) { | |
1080 | // show error message and disable Finish button | |
1081 | parentWizardPage.setErrorMessage(SDMessages._135); | |
1082 | parentWizardPage.setPageComplete(false); | |
1083 | } else { | |
1084 | // clear error message and enable Finish button | |
1085 | parentWizardPage.setErrorMessage(null); | |
1086 | parentWizardPage.setPageComplete(true); | |
1087 | } | |
1088 | } else if (parentDialog != null) { | |
1089 | // used in the print dialog | |
1090 | if (printerData == null) { | |
1091 | // show error message and disable OK button | |
1092 | parentDialog.setErrorMessage(SDMessages._135); | |
1093 | parentDialog.setPageComplete(false); | |
1094 | } else { | |
1095 | // clear error message and enable OK button | |
1096 | parentDialog.setErrorMessage(null); | |
1097 | parentDialog.setPageComplete(true); | |
1098 | } | |
1099 | } | |
1100 | } | |
1101 | ||
1102 | } |