|
Lines 87-92
Link Here
|
| 87 |
import org.eclipse.ui.IWorkbenchPage; |
87 |
import org.eclipse.ui.IWorkbenchPage; |
| 88 |
import org.eclipse.ui.PartInitException; |
88 |
import org.eclipse.ui.PartInitException; |
| 89 |
import org.eclipse.ui.PlatformUI; |
89 |
import org.eclipse.ui.PlatformUI; |
|
|
90 |
import org.eclipse.ui.XMLMemento; |
| 90 |
import org.eclipse.ui.part.ViewPart; |
91 |
import org.eclipse.ui.part.ViewPart; |
| 91 |
|
92 |
|
| 92 |
public class LogView extends ViewPart implements ILogListener { |
93 |
public class LogView extends ViewPart implements ILogListener { |
|
Lines 117-123
Link Here
|
| 117 |
|
118 |
|
| 118 |
// private Clipboard fClipboard; |
119 |
// private Clipboard fClipboard; |
| 119 |
|
120 |
|
| 120 |
// private IMemento fMemento; |
121 |
private IMemento fMemento; |
| 121 |
private File fInputFile; |
122 |
private File fInputFile; |
| 122 |
private String fDirectory; |
123 |
private String fDirectory; |
| 123 |
|
124 |
|
|
Lines 233-242
Link Here
|
| 233 |
private Action createActivateViewAction() { |
234 |
private Action createActivateViewAction() { |
| 234 |
Action action = new Action(PDERuntimeMessages.get().LogView_activate) { // |
235 |
Action action = new Action(PDERuntimeMessages.get().LogView_activate) { // |
| 235 |
public void run() { |
236 |
public void run() { |
| 236 |
// fMemento.putString(P_ACTIVATE, isChecked() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ |
237 |
fMemento.putString(P_ACTIVATE, isChecked() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ |
| 237 |
} |
238 |
} |
| 238 |
}; |
239 |
}; |
| 239 |
// action.setChecked(fMemento.getString(P_ACTIVATE).equals("true")); //$NON-NLS-1$ |
240 |
action.setChecked(fMemento.getString(P_ACTIVATE).equals("true")); //$NON-NLS-1$ |
| 240 |
return action; |
241 |
return action; |
| 241 |
} |
242 |
} |
| 242 |
|
243 |
|
|
Lines 391-397
Link Here
|
| 391 |
private void createColumns(Tree tree) { |
392 |
private void createColumns(Tree tree) { |
| 392 |
fColumn1 = new TreeColumn(tree, SWT.LEFT); |
393 |
fColumn1 = new TreeColumn(tree, SWT.LEFT); |
| 393 |
fColumn1.setText(PDERuntimeMessages.get().LogView_column_message); |
394 |
fColumn1.setText(PDERuntimeMessages.get().LogView_column_message); |
| 394 |
// fColumn1.setWidth(fMemento.getInteger(P_COLUMN_1).intValue()); |
395 |
fColumn1.setWidth(fMemento.getInteger(P_COLUMN_1).intValue()); |
| 395 |
fColumn1.setWidth(300); |
396 |
fColumn1.setWidth(300); |
| 396 |
fColumn1.addSelectionListener(new SelectionAdapter() { |
397 |
fColumn1.addSelectionListener(new SelectionAdapter() { |
| 397 |
public void widgetSelected(SelectionEvent e) { |
398 |
public void widgetSelected(SelectionEvent e) { |
|
Lines 403-417
Link Here
|
| 403 |
setComparator(MESSAGE); |
404 |
setComparator(MESSAGE); |
| 404 |
if (!isComparatorSet) |
405 |
if (!isComparatorSet) |
| 405 |
((EventDetailsDialogAction) fPropertiesAction).setComparator(fComparator); |
406 |
((EventDetailsDialogAction) fPropertiesAction).setComparator(fComparator); |
| 406 |
// fMemento.putInteger(P_ORDER_VALUE, MESSAGE_ORDER); |
407 |
fMemento.putInteger(P_ORDER_VALUE, MESSAGE_ORDER); |
| 407 |
// fMemento.putInteger(P_ORDER_TYPE, MESSAGE); |
408 |
fMemento.putInteger(P_ORDER_TYPE, MESSAGE); |
| 408 |
setColumnSorting(fColumn1, MESSAGE_ORDER); |
409 |
setColumnSorting(fColumn1, MESSAGE_ORDER); |
| 409 |
} |
410 |
} |
| 410 |
}); |
411 |
}); |
| 411 |
|
412 |
|
| 412 |
fColumn2 = new TreeColumn(tree, SWT.LEFT); |
413 |
fColumn2 = new TreeColumn(tree, SWT.LEFT); |
| 413 |
fColumn2.setText(PDERuntimeMessages.get().LogView_column_plugin); |
414 |
fColumn2.setText(PDERuntimeMessages.get().LogView_column_plugin); |
| 414 |
// fColumn2.setWidth(fMemento.getInteger(P_COLUMN_2).intValue()); |
415 |
fColumn2.setWidth(fMemento.getInteger(P_COLUMN_2).intValue()); |
| 415 |
fColumn2.setWidth(150); |
416 |
fColumn2.setWidth(150); |
| 416 |
fColumn2.addSelectionListener(new SelectionAdapter() { |
417 |
fColumn2.addSelectionListener(new SelectionAdapter() { |
| 417 |
public void widgetSelected(SelectionEvent e) { |
418 |
public void widgetSelected(SelectionEvent e) { |
|
Lines 423-437
Link Here
|
| 423 |
setComparator(PLUGIN); |
424 |
setComparator(PLUGIN); |
| 424 |
if (!isComparatorSet) |
425 |
if (!isComparatorSet) |
| 425 |
((EventDetailsDialogAction) fPropertiesAction).setComparator(fComparator); |
426 |
((EventDetailsDialogAction) fPropertiesAction).setComparator(fComparator); |
| 426 |
// fMemento.putInteger(P_ORDER_VALUE, PLUGIN_ORDER); |
427 |
fMemento.putInteger(P_ORDER_VALUE, PLUGIN_ORDER); |
| 427 |
// fMemento.putInteger(P_ORDER_TYPE, PLUGIN); |
428 |
fMemento.putInteger(P_ORDER_TYPE, PLUGIN); |
| 428 |
setColumnSorting(fColumn2, PLUGIN_ORDER); |
429 |
setColumnSorting(fColumn2, PLUGIN_ORDER); |
| 429 |
} |
430 |
} |
| 430 |
}); |
431 |
}); |
| 431 |
|
432 |
|
| 432 |
fColumn3 = new TreeColumn(tree, SWT.LEFT); |
433 |
fColumn3 = new TreeColumn(tree, SWT.LEFT); |
| 433 |
fColumn3.setText(PDERuntimeMessages.get().LogView_column_date); |
434 |
fColumn3.setText(PDERuntimeMessages.get().LogView_column_date); |
| 434 |
// fColumn3.setWidth(fMemento.getInteger(P_COLUMN_3).intValue()); |
435 |
fColumn3.setWidth(fMemento.getInteger(P_COLUMN_3).intValue()); |
| 435 |
fColumn3.setWidth(150); |
436 |
fColumn3.setWidth(150); |
| 436 |
fColumn3.addSelectionListener(new SelectionAdapter() { |
437 |
fColumn3.addSelectionListener(new SelectionAdapter() { |
| 437 |
public void widgetSelected(SelectionEvent e) { |
438 |
public void widgetSelected(SelectionEvent e) { |
|
Lines 440-447
Link Here
|
| 440 |
fTreeViewer.setComparator(comparator); |
441 |
fTreeViewer.setComparator(comparator); |
| 441 |
setComparator(DATE); |
442 |
setComparator(DATE); |
| 442 |
((EventDetailsDialogAction) fPropertiesAction).setComparator(fComparator); |
443 |
((EventDetailsDialogAction) fPropertiesAction).setComparator(fComparator); |
| 443 |
// fMemento.putInteger(P_ORDER_VALUE, DATE_ORDER); |
444 |
fMemento.putInteger(P_ORDER_VALUE, DATE_ORDER); |
| 444 |
// fMemento.putInteger(P_ORDER_TYPE, DATE); |
445 |
fMemento.putInteger(P_ORDER_TYPE, DATE); |
| 445 |
setColumnSorting(fColumn3, DATE_ORDER); |
446 |
setColumnSorting(fColumn3, DATE_ORDER); |
| 446 |
} |
447 |
} |
| 447 |
}); |
448 |
}); |
|
Lines 450-464
Link Here
|
| 450 |
} |
451 |
} |
| 451 |
|
452 |
|
| 452 |
private void initializeViewerSorter() { |
453 |
private void initializeViewerSorter() { |
| 453 |
// byte orderType = fMemento.getInteger(P_ORDER_TYPE).byteValue(); |
454 |
byte orderType = fMemento.getInteger(P_ORDER_TYPE).byteValue(); |
| 454 |
byte orderType = DATE; |
|
|
| 455 |
ViewerComparator comparator = getViewerComparator(orderType); |
455 |
ViewerComparator comparator = getViewerComparator(orderType); |
| 456 |
fTreeViewer.setComparator(comparator); |
456 |
fTreeViewer.setComparator(comparator); |
| 457 |
// if (orderType == MESSAGE ) |
457 |
if (orderType == MESSAGE ) |
| 458 |
// setColumnSorting(fColumn1, MESSAGE_ORDER); |
458 |
setColumnSorting(fColumn1, MESSAGE_ORDER); |
| 459 |
// else if (orderType == PLUGIN) |
459 |
else if (orderType == PLUGIN) |
| 460 |
// setColumnSorting(fColumn2, PLUGIN_ORDER); |
460 |
setColumnSorting(fColumn2, PLUGIN_ORDER); |
| 461 |
// else if (orderType == DATE) |
461 |
else if (orderType == DATE) |
| 462 |
setColumnSorting(fColumn3, DATE_ORDER); |
462 |
setColumnSorting(fColumn3, DATE_ORDER); |
| 463 |
} |
463 |
} |
| 464 |
|
464 |
|
|
Lines 555-562
Link Here
|
| 555 |
} |
555 |
} |
| 556 |
|
556 |
|
| 557 |
private void handleFilter() { |
557 |
private void handleFilter() { |
| 558 |
FilterDialog dialog = new FilterDialog(PDERuntimePlugin.getActiveWorkbenchShell(), null); |
558 |
FilterDialog dialog = new FilterDialog(PDERuntimePlugin.getActiveWorkbenchShell(), fMemento); |
| 559 |
// FilterDialog dialog = new FilterDialog(PDERuntimePlugin.getActiveWorkbenchShell(), fMemento); |
|
|
| 560 |
dialog.create(); |
559 |
dialog.create(); |
| 561 |
dialog.getShell().setText(PDERuntimeMessages.get().LogView_FilterDialog_title); |
560 |
dialog.getShell().setText(PDERuntimeMessages.get().LogView_FilterDialog_title); |
| 562 |
if (dialog.open() == Window.OK) |
561 |
if (dialog.open() == Window.OK) |
|
Lines 617-624
Link Here
|
| 617 |
fLogs.clear(); |
616 |
fLogs.clear(); |
| 618 |
if (!fInputFile.exists()) |
617 |
if (!fInputFile.exists()) |
| 619 |
return; |
618 |
return; |
| 620 |
LogReader.parseLogFile(fInputFile, fLogs, null); |
619 |
LogReader.parseLogFile(fInputFile, fLogs, fMemento); |
| 621 |
// LogReader.parseLogFile(fInputFile, fLogs, fMemento); |
|
|
| 622 |
} |
620 |
} |
| 623 |
|
621 |
|
| 624 |
public void logging(IStatus status, String plugin) { |
622 |
public void logging(IStatus status, String plugin) { |
|
Lines 635-642
Link Here
|
| 635 |
|
633 |
|
| 636 |
private void pushStatus(IStatus status) { |
634 |
private void pushStatus(IStatus status) { |
| 637 |
LogEntry entry = new LogEntry(status); |
635 |
LogEntry entry = new LogEntry(status); |
| 638 |
LogReader.addEntry(entry, fLogs, null, true); |
636 |
LogReader.addEntry(entry, fLogs, fMemento, true); |
| 639 |
// LogReader.addEntry(entry, fLogs, fMemento, true); |
|
|
| 640 |
asyncRefresh(); |
637 |
asyncRefresh(); |
| 641 |
} |
638 |
} |
| 642 |
|
639 |
|
|
Lines 714-791
Link Here
|
| 714 |
|
711 |
|
| 715 |
public void init(IViewSite site, IMemento memento) throws PartInitException { |
712 |
public void init(IViewSite site, IMemento memento) throws PartInitException { |
| 716 |
super.init(site, memento); |
713 |
super.init(site, memento); |
| 717 |
// if (memento == null) |
714 |
if (memento == null) |
| 718 |
// this.fMemento = XMLMemento.createWriteRoot("LOGVIEW"); //$NON-NLS-1$ |
715 |
this.fMemento = XMLMemento.createWriteRoot("LOGVIEW"); //$NON-NLS-1$ |
| 719 |
// else |
716 |
else |
| 720 |
// this.fMemento = memento; |
717 |
this.fMemento = memento; |
| 721 |
// readSettings(); |
718 |
readSettings(); |
| 722 |
|
719 |
|
| 723 |
// initialize column ordering |
720 |
// initialize column ordering |
| 724 |
// final byte type = this.fMemento.getInteger(P_ORDER_TYPE).byteValue(); |
721 |
final byte type = this.fMemento.getInteger(P_ORDER_TYPE).byteValue(); |
| 725 |
// switch (type){ |
722 |
switch (type){ |
| 726 |
// case DATE: |
723 |
case DATE: |
| 727 |
// DATE_ORDER = this.fMemento.getInteger(P_ORDER_VALUE).intValue(); |
724 |
DATE_ORDER = this.fMemento.getInteger(P_ORDER_VALUE).intValue(); |
| 728 |
// MESSAGE_ORDER = DESCENDING; |
725 |
MESSAGE_ORDER = DESCENDING; |
| 729 |
// PLUGIN_ORDER = DESCENDING; |
726 |
PLUGIN_ORDER = DESCENDING; |
| 730 |
// break; |
727 |
break; |
| 731 |
// case MESSAGE: |
728 |
case MESSAGE: |
| 732 |
// MESSAGE_ORDER = this.fMemento.getInteger(P_ORDER_VALUE).intValue(); |
729 |
MESSAGE_ORDER = this.fMemento.getInteger(P_ORDER_VALUE).intValue(); |
| 733 |
// DATE_ORDER = DESCENDING; |
730 |
DATE_ORDER = DESCENDING; |
| 734 |
// PLUGIN_ORDER = DESCENDING; |
731 |
PLUGIN_ORDER = DESCENDING; |
| 735 |
// break; |
732 |
break; |
| 736 |
// case PLUGIN: |
733 |
case PLUGIN: |
| 737 |
// PLUGIN_ORDER = this.fMemento.getInteger(P_ORDER_VALUE).intValue(); |
734 |
PLUGIN_ORDER = this.fMemento.getInteger(P_ORDER_VALUE).intValue(); |
| 738 |
// MESSAGE_ORDER = DESCENDING; |
735 |
MESSAGE_ORDER = DESCENDING; |
| 739 |
// DATE_ORDER = DESCENDING; |
736 |
DATE_ORDER = DESCENDING; |
| 740 |
// break; |
737 |
break; |
| 741 |
// default: |
738 |
default: |
| 742 |
DATE_ORDER = DESCENDING; |
739 |
DATE_ORDER = DESCENDING; |
| 743 |
MESSAGE_ORDER = DESCENDING; |
740 |
MESSAGE_ORDER = DESCENDING; |
| 744 |
PLUGIN_ORDER = DESCENDING; |
741 |
PLUGIN_ORDER = DESCENDING; |
| 745 |
// } |
742 |
} |
| 746 |
// setComparator(fMemento.getInteger(P_ORDER_TYPE).byteValue()); |
743 |
setComparator(fMemento.getInteger(P_ORDER_TYPE).byteValue()); |
| 747 |
setComparator(DATE); |
|
|
| 748 |
} |
744 |
} |
| 749 |
|
745 |
|
| 750 |
private void initializeMemento() { |
746 |
private void initializeMemento() { |
| 751 |
// if (fMemento.getString(P_USE_LIMIT) == null) |
747 |
if (fMemento.getString(P_USE_LIMIT) == null) |
| 752 |
// fMemento.putString(P_USE_LIMIT, "true"); //$NON-NLS-1$ |
748 |
fMemento.putString(P_USE_LIMIT, "true"); //$NON-NLS-1$ |
| 753 |
// if (fMemento.getInteger(P_LOG_LIMIT) == null) |
749 |
if (fMemento.getInteger(P_LOG_LIMIT) == null) |
| 754 |
// fMemento.putInteger(P_LOG_LIMIT, 50); |
750 |
fMemento.putInteger(P_LOG_LIMIT, 50); |
| 755 |
// if (fMemento.getString(P_LOG_INFO) == null) |
751 |
if (fMemento.getString(P_LOG_INFO) == null) |
| 756 |
// fMemento.putString(P_LOG_INFO, "true"); //$NON-NLS-1$ |
752 |
fMemento.putString(P_LOG_INFO, "true"); //$NON-NLS-1$ |
| 757 |
// if (fMemento.getString(P_LOG_WARNING) == null) |
753 |
if (fMemento.getString(P_LOG_WARNING) == null) |
| 758 |
// fMemento.putString(P_LOG_WARNING, "true"); //$NON-NLS-1$ |
754 |
fMemento.putString(P_LOG_WARNING, "true"); //$NON-NLS-1$ |
| 759 |
// if (fMemento.getString(P_LOG_ERROR) == null) |
755 |
if (fMemento.getString(P_LOG_ERROR) == null) |
| 760 |
// fMemento.putString(P_LOG_ERROR, "true"); //$NON-NLS-1$ |
756 |
fMemento.putString(P_LOG_ERROR, "true"); //$NON-NLS-1$ |
| 761 |
// if (fMemento.getString(P_SHOW_ALL_SESSIONS) == null) |
757 |
if (fMemento.getString(P_SHOW_ALL_SESSIONS) == null) |
| 762 |
// fMemento.putString(P_SHOW_ALL_SESSIONS, "true"); //$NON-NLS-1$ |
758 |
fMemento.putString(P_SHOW_ALL_SESSIONS, "true"); //$NON-NLS-1$ |
| 763 |
// Integer width = fMemento.getInteger(P_COLUMN_1); |
759 |
Integer width = fMemento.getInteger(P_COLUMN_1); |
| 764 |
// if (width == null || width.intValue() == 0) |
760 |
if (width == null || width.intValue() == 0) |
| 765 |
// fMemento.putInteger(P_COLUMN_1, 300); |
761 |
fMemento.putInteger(P_COLUMN_1, 300); |
| 766 |
// width = fMemento.getInteger(P_COLUMN_2); |
762 |
width = fMemento.getInteger(P_COLUMN_2); |
| 767 |
// if (width == null || width.intValue() == 0) |
763 |
if (width == null || width.intValue() == 0) |
| 768 |
// fMemento.putInteger(P_COLUMN_2, 150); |
764 |
fMemento.putInteger(P_COLUMN_2, 150); |
| 769 |
// width = fMemento.getInteger(P_COLUMN_3); |
765 |
width = fMemento.getInteger(P_COLUMN_3); |
| 770 |
// if (width == null || width.intValue() == 0) |
766 |
if (width == null || width.intValue() == 0) |
| 771 |
// fMemento.putInteger(P_COLUMN_3, 150); |
767 |
fMemento.putInteger(P_COLUMN_3, 150); |
| 772 |
// if (fMemento.getString(P_ACTIVATE) == null) |
768 |
if (fMemento.getString(P_ACTIVATE) == null) |
| 773 |
// fMemento.putString(P_ACTIVATE, "true"); //$NON-NLS-1$ |
769 |
fMemento.putString(P_ACTIVATE, "true"); //$NON-NLS-1$ |
| 774 |
// |
770 |
|
| 775 |
// fMemento.putInteger(P_ORDER_VALUE, DESCENDING); |
771 |
fMemento.putInteger(P_ORDER_VALUE, DESCENDING); |
| 776 |
// fMemento.putInteger(P_ORDER_TYPE, DATE); |
772 |
fMemento.putInteger(P_ORDER_TYPE, DATE); |
| 777 |
} |
773 |
} |
| 778 |
|
774 |
|
| 779 |
public void saveState(IMemento memento) { |
775 |
public void saveState(IMemento memento) { |
| 780 |
// if (this.fMemento == null || memento == null) |
776 |
if (this.fMemento == null || memento == null) |
| 781 |
// return; |
777 |
return; |
| 782 |
// this.fMemento.putInteger(P_COLUMN_1, fColumn1.getWidth()); |
778 |
this.fMemento.putInteger(P_COLUMN_1, fColumn1.getWidth()); |
| 783 |
// this.fMemento.putInteger(P_COLUMN_2, fColumn2.getWidth()); |
779 |
this.fMemento.putInteger(P_COLUMN_2, fColumn2.getWidth()); |
| 784 |
// this.fMemento.putInteger(P_COLUMN_3, fColumn3.getWidth()); |
780 |
this.fMemento.putInteger(P_COLUMN_3, fColumn3.getWidth()); |
| 785 |
// this.fMemento.putString(P_ACTIVATE, |
781 |
this.fMemento.putString(P_ACTIVATE, |
| 786 |
// fActivateViewAction.isChecked() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ |
782 |
fActivateViewAction.isChecked() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ |
| 787 |
// memento.putMemento(this.fMemento); |
783 |
memento.putMemento(this.fMemento); |
| 788 |
// writeSettings(); |
784 |
writeSettings(); |
| 789 |
} |
785 |
} |
| 790 |
|
786 |
|
| 791 |
private void addMouseListeners() { |
787 |
private void addMouseListeners() { |
|
Lines 1019-1044
Link Here
|
| 1019 |
return; |
1015 |
return; |
| 1020 |
} |
1016 |
} |
| 1021 |
try { |
1017 |
try { |
| 1022 |
// fMemento.putString(P_USE_LIMIT, s.getBoolean(P_USE_LIMIT) ? "true":"false"); //$NON-NLS-1$ //$NON-NLS-2$ |
1018 |
fMemento.putString(P_USE_LIMIT, s.getBoolean(P_USE_LIMIT) ? "true":"false"); //$NON-NLS-1$ //$NON-NLS-2$ |
| 1023 |
// fMemento.putString(P_LOG_INFO, s.getBoolean(P_LOG_INFO) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ |
1019 |
fMemento.putString(P_LOG_INFO, s.getBoolean(P_LOG_INFO) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ |
| 1024 |
// fMemento.putString(P_LOG_WARNING, s.getBoolean(P_LOG_WARNING) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ |
1020 |
fMemento.putString(P_LOG_WARNING, s.getBoolean(P_LOG_WARNING) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ |
| 1025 |
// fMemento.putString(P_LOG_ERROR, s.getBoolean(P_LOG_ERROR) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ |
1021 |
fMemento.putString(P_LOG_ERROR, s.getBoolean(P_LOG_ERROR) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ |
| 1026 |
// fMemento.putString(P_SHOW_ALL_SESSIONS, s.getBoolean(P_SHOW_ALL_SESSIONS) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ |
1022 |
fMemento.putString(P_SHOW_ALL_SESSIONS, s.getBoolean(P_SHOW_ALL_SESSIONS) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ |
| 1027 |
// fMemento.putInteger(P_LOG_LIMIT, s.getInt(P_LOG_LIMIT)); |
1023 |
fMemento.putInteger(P_LOG_LIMIT, s.getInt(P_LOG_LIMIT)); |
| 1028 |
// fMemento.putInteger(P_COLUMN_1, p.getInt(P_COLUMN_1) > 0 ? p.getInt(P_COLUMN_1) : 300); |
1024 |
fMemento.putInteger(P_COLUMN_1, p.getInt(P_COLUMN_1) > 0 ? p.getInt(P_COLUMN_1) : 300); |
| 1029 |
// fMemento.putInteger(P_COLUMN_2, p.getInt(P_COLUMN_2) > 0 ? p.getInt(P_COLUMN_2) : 150); |
1025 |
fMemento.putInteger(P_COLUMN_2, p.getInt(P_COLUMN_2) > 0 ? p.getInt(P_COLUMN_2) : 150); |
| 1030 |
// fMemento.putInteger(P_COLUMN_3, p.getInt(P_COLUMN_3) > 0 ? p.getInt(P_COLUMN_3) : 150); |
1026 |
fMemento.putInteger(P_COLUMN_3, p.getInt(P_COLUMN_3) > 0 ? p.getInt(P_COLUMN_3) : 150); |
| 1031 |
// fMemento.putString(P_ACTIVATE, p.getBoolean(P_ACTIVATE) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ |
1027 |
fMemento.putString(P_ACTIVATE, p.getBoolean(P_ACTIVATE) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ |
| 1032 |
// int order = p.getInt(P_ORDER_VALUE); |
1028 |
int order = p.getInt(P_ORDER_VALUE); |
| 1033 |
// fMemento.putInteger(P_ORDER_VALUE, order == 0 ? DESCENDING : order); |
1029 |
fMemento.putInteger(P_ORDER_VALUE, order == 0 ? DESCENDING : order); |
| 1034 |
// fMemento.putInteger(P_ORDER_TYPE, p.getInt(P_ORDER_TYPE)); |
1030 |
fMemento.putInteger(P_ORDER_TYPE, p.getInt(P_ORDER_TYPE)); |
| 1035 |
} catch (NumberFormatException e) { |
1031 |
} catch (NumberFormatException e) { |
| 1036 |
// fMemento.putInteger(P_LOG_LIMIT, 50); |
1032 |
fMemento.putInteger(P_LOG_LIMIT, 50); |
| 1037 |
// fMemento.putInteger(P_COLUMN_1, 300); |
1033 |
fMemento.putInteger(P_COLUMN_1, 300); |
| 1038 |
// fMemento.putInteger(P_COLUMN_2, 150); |
1034 |
fMemento.putInteger(P_COLUMN_2, 150); |
| 1039 |
// fMemento.putInteger(P_COLUMN_3, 150); |
1035 |
fMemento.putInteger(P_COLUMN_3, 150); |
| 1040 |
// fMemento.putInteger(P_ORDER_TYPE, DATE); |
1036 |
fMemento.putInteger(P_ORDER_TYPE, DATE); |
| 1041 |
// fMemento.putInteger(P_ORDER_VALUE, DESCENDING); |
1037 |
fMemento.putInteger(P_ORDER_VALUE, DESCENDING); |
| 1042 |
} |
1038 |
} |
| 1043 |
} |
1039 |
} |
| 1044 |
|
1040 |
|
|
Lines 1051-1073
Link Here
|
| 1051 |
IDialogSettings settings = getLogSettings(); |
1047 |
IDialogSettings settings = getLogSettings(); |
| 1052 |
if (settings == null) |
1048 |
if (settings == null) |
| 1053 |
settings = PDERuntimePlugin.getDefault().getDialogSettings().addNewSection(getClass().getName()); |
1049 |
settings = PDERuntimePlugin.getDefault().getDialogSettings().addNewSection(getClass().getName()); |
| 1054 |
// settings.put(P_USE_LIMIT, fMemento.getString(P_USE_LIMIT).equals("true")); //$NON-NLS-1$ |
1050 |
settings.put(P_USE_LIMIT, fMemento.getString(P_USE_LIMIT).equals("true")); //$NON-NLS-1$ |
| 1055 |
// settings.put(P_LOG_LIMIT, fMemento.getInteger(P_LOG_LIMIT).intValue()); |
1051 |
settings.put(P_LOG_LIMIT, fMemento.getInteger(P_LOG_LIMIT).intValue()); |
| 1056 |
// settings.put(P_LOG_INFO, fMemento.getString(P_LOG_INFO).equals("true")); //$NON-NLS-1$ |
1052 |
settings.put(P_LOG_INFO, fMemento.getString(P_LOG_INFO).equals("true")); //$NON-NLS-1$ |
| 1057 |
// settings.put(P_LOG_WARNING, fMemento.getString(P_LOG_WARNING).equals("true")); //$NON-NLS-1$ |
1053 |
settings.put(P_LOG_WARNING, fMemento.getString(P_LOG_WARNING).equals("true")); //$NON-NLS-1$ |
| 1058 |
// settings.put(P_LOG_ERROR, fMemento.getString(P_LOG_ERROR).equals("true")); //$NON-NLS-1$ |
1054 |
settings.put(P_LOG_ERROR, fMemento.getString(P_LOG_ERROR).equals("true")); //$NON-NLS-1$ |
| 1059 |
// settings.put(P_SHOW_ALL_SESSIONS, fMemento.getString(P_SHOW_ALL_SESSIONS).equals("true")); //$NON-NLS-1$ |
1055 |
settings.put(P_SHOW_ALL_SESSIONS, fMemento.getString(P_SHOW_ALL_SESSIONS).equals("true")); //$NON-NLS-1$ |
| 1060 |
} |
1056 |
} |
| 1061 |
|
1057 |
|
| 1062 |
private void writeViewSettings(){ |
1058 |
private void writeViewSettings(){ |
| 1063 |
Preferences preferences = getLogPreferences(); |
1059 |
Preferences preferences = getLogPreferences(); |
| 1064 |
// preferences.setValue(P_COLUMN_1, fMemento.getInteger(P_COLUMN_1).intValue()); |
1060 |
preferences.setValue(P_COLUMN_1, fMemento.getInteger(P_COLUMN_1).intValue()); |
| 1065 |
// preferences.setValue(P_COLUMN_2, fMemento.getInteger(P_COLUMN_2).intValue()); |
1061 |
preferences.setValue(P_COLUMN_2, fMemento.getInteger(P_COLUMN_2).intValue()); |
| 1066 |
// preferences.setValue(P_COLUMN_3, fMemento.getInteger(P_COLUMN_3).intValue()); |
1062 |
preferences.setValue(P_COLUMN_3, fMemento.getInteger(P_COLUMN_3).intValue()); |
| 1067 |
// preferences.setValue(P_ACTIVATE, fMemento.getString(P_ACTIVATE).equals("true")); //$NON-NLS-1$ |
1063 |
preferences.setValue(P_ACTIVATE, fMemento.getString(P_ACTIVATE).equals("true")); //$NON-NLS-1$ |
| 1068 |
// int order = fMemento.getInteger(P_ORDER_VALUE).intValue(); |
1064 |
int order = fMemento.getInteger(P_ORDER_VALUE).intValue(); |
| 1069 |
// preferences.setValue(P_ORDER_VALUE, order == 0 ? DESCENDING : order); |
1065 |
preferences.setValue(P_ORDER_VALUE, order == 0 ? DESCENDING : order); |
| 1070 |
// preferences.setValue(P_ORDER_TYPE, fMemento.getInteger(P_ORDER_TYPE).intValue()); |
1066 |
preferences.setValue(P_ORDER_TYPE, fMemento.getInteger(P_ORDER_TYPE).intValue()); |
| 1071 |
} |
1067 |
} |
| 1072 |
|
1068 |
|
| 1073 |
public void sortByDateDescending() { |
1069 |
public void sortByDateDescending() { |
|
Lines 1075-1084
Link Here
|
| 1075 |
} |
1071 |
} |
| 1076 |
|
1072 |
|
| 1077 |
protected Job getOpenLogFileJob() { |
1073 |
protected Job getOpenLogFileJob() { |
|
|
1074 |
final Display display=Display.getDefault(); |
| 1078 |
final Shell shell = getViewSite().getShell(); |
1075 |
final Shell shell = getViewSite().getShell(); |
| 1079 |
return new Job(PDERuntimeMessages.get().OpenLogDialog_message) { |
1076 |
return new Job(PDERuntimeMessages.get().OpenLogDialog_message) { |
| 1080 |
protected IStatus run(IProgressMonitor monitor) { |
1077 |
protected IStatus run(IProgressMonitor monitor) { |
| 1081 |
boolean failed = false; |
1078 |
boolean failed = true; |
| 1082 |
if (fInputFile.length() <= LogReader.MAX_FILE_LENGTH) { |
1079 |
if (fInputFile.length() <= LogReader.MAX_FILE_LENGTH) { |
| 1083 |
// failed = !Program.launch(fInputFile.getAbsolutePath()); |
1080 |
// failed = !Program.launch(fInputFile.getAbsolutePath()); |
| 1084 |
// if (failed) { |
1081 |
// if (failed) { |
|
Lines 1091-1097
Link Here
|
| 1091 |
} |
1088 |
} |
| 1092 |
if (failed) { |
1089 |
if (failed) { |
| 1093 |
final OpenLogDialog openDialog = new OpenLogDialog(shell, fInputFile); |
1090 |
final OpenLogDialog openDialog = new OpenLogDialog(shell, fInputFile); |
| 1094 |
Display.getDefault().asyncExec(new Runnable() { |
1091 |
display.asyncExec(new Runnable() { |
| 1095 |
public void run() { |
1092 |
public void run() { |
| 1096 |
openDialog.create(); |
1093 |
openDialog.create(); |
| 1097 |
openDialog.open(); |
1094 |
openDialog.open(); |