Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 197362 Details for
Bug 347957
RAP PDE Runtime: NullpointerException trying to open filter dialog
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch-v2: improved version, that also restore import/export platform log file
filter.patch (text/plain), 49.64 KB, created by
Arnaud MERGEY
on 2011-06-05 12:45:29 EDT
(
hide
)
Description:
patch-v2: improved version, that also restore import/export platform log file
Filename:
MIME Type:
Creator:
Arnaud MERGEY
Created:
2011-06-05 12:45:29 EDT
Size:
49.64 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.pde.runtime >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/sandbox/org.eclipse.rap.pde.runtime/META-INF/MANIFEST.MF,v >retrieving revision 1.2 >diff -u -r1.2 MANIFEST.MF >--- META-INF/MANIFEST.MF 10 Oct 2007 12:28:06 -0000 1.2 >+++ META-INF/MANIFEST.MF 5 Jun 2011 16:41:02 -0000 >@@ -9,8 +9,11 @@ > Export-Package: org.eclipse.pde.internal.runtime;x-internal:=true,org.eclipse.pde.internal.runtime.logview;x-friends:="org.eclipse.pde.ui",org.eclipse.pde.internal.runtime.registry;x-internal:=true > Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", > org.eclipse.core.filesystem;bundle-version="[1.1.0,2.0.0)";resolution:=optional, >- org.eclipse.rap.ui >+ org.eclipse.rap.ui, >+ org.eclipse.rap.rwt.supplemental.filedialog;bundle-version="1.4.0" > Bundle-RequiredExecutionEnvironment: J2SE-1.4 > Ant-Version: Apache Ant 1.7.0 > Created-By: 1.4.2 (IBM Corporation) > Eclipse-LazyStart: true >+Import-Package: javax.servlet;version="2.5.0", >+ javax.servlet.http;version="2.5.0" >Index: filter.patch >=================================================================== >RCS file: filter.patch >diff -N filter.patch >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ filter.patch 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,459 @@ >+### Eclipse Workspace Patch 1.0 >+#P org.eclipse.rap.pde.runtime >+Index: src/org/eclipse/pde/internal/runtime/logview/LogReader.java >+=================================================================== >+RCS file: /cvsroot/rt/org.eclipse.rap/sandbox/org.eclipse.rap.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogReader.java,v >+retrieving revision 1.2 >+diff -u -r1.2 LogReader.java >+--- src/org/eclipse/pde/internal/runtime/logview/LogReader.java 10 Oct 2007 12:28:06 -0000 1.2 >++++ src/org/eclipse/pde/internal/runtime/logview/LogReader.java 1 Jun 2011 14:59:32 -0000 >+@@ -20,6 +20,7 @@ >+ import java.util.ArrayList; >+ import java.util.Date; >+ >++import org.eclipse.core.runtime.IStatus; >+ import org.eclipse.ui.IMemento; >+ >+ class LogReader { >+@@ -102,7 +103,7 @@ >+ writer = new PrintWriter(swriter, true); >+ writerState = SESSION_STATE; >+ updateCurrentSession(session); >+- if (!currentSession.equals(session) /*&& !memento.getString(LogView.P_SHOW_ALL_SESSIONS).equals("true")*/) //$NON-NLS-1$ >++ if (!currentSession.equals(session) && !memento.getString(LogView.P_SHOW_ALL_SESSIONS).equals("true")) //$NON-NLS-1$ >+ entries.clear(); >+ } else if (state == ENTRY_STATE) { >+ LogEntry entry = new LogEntry(); >+@@ -167,25 +168,25 @@ >+ public synchronized static void addEntry(LogEntry current, ArrayList entries, IMemento memento, boolean useCurrentSession) { >+ int severity = current.getSeverity(); >+ boolean doAdd = true; >+-// switch(severity) { >+-// case IStatus.INFO: >+-// doAdd = memento.getString(LogView.P_LOG_INFO).equals("true"); //$NON-NLS-1$ >+-// break; >+-// case IStatus.WARNING: >+-// doAdd = memento.getString(LogView.P_LOG_WARNING).equals("true"); //$NON-NLS-1$ >+-// break; >+-// case IStatus.ERROR: >+-// doAdd = memento.getString(LogView.P_LOG_ERROR).equals("true"); //$NON-NLS-1$ >+-// break; >+-// } >++ switch(severity) { >++ case IStatus.INFO: >++ doAdd = memento.getString(LogView.P_LOG_INFO).equals("true"); //$NON-NLS-1$ >++ break; >++ case IStatus.WARNING: >++ doAdd = memento.getString(LogView.P_LOG_WARNING).equals("true"); //$NON-NLS-1$ >++ break; >++ case IStatus.ERROR: >++ doAdd = memento.getString(LogView.P_LOG_ERROR).equals("true"); //$NON-NLS-1$ >++ break; >++ } >+ if (doAdd) { >+ if (useCurrentSession) >+ current.setSession(currentSession); >+ entries.add(0, current); >+ >+-// if (memento.getString(LogView.P_USE_LIMIT).equals("true") //$NON-NLS-1$ >+-// && entries.size() > memento.getInteger(LogView.P_LOG_LIMIT).intValue()) >+-// entries.remove(entries.size() - 1); >++ if (memento.getString(LogView.P_USE_LIMIT).equals("true") //$NON-NLS-1$ >++ && entries.size() > memento.getInteger(LogView.P_LOG_LIMIT).intValue()) >++ entries.remove(entries.size() - 1); >+ } >+ } >+ >+Index: src/org/eclipse/pde/internal/runtime/logview/LogView.java >+=================================================================== >+RCS file: /cvsroot/rt/org.eclipse.rap/sandbox/org.eclipse.rap.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogView.java,v >+retrieving revision 1.5 >+diff -u -r1.5 LogView.java >+--- src/org/eclipse/pde/internal/runtime/logview/LogView.java 11 Dec 2007 14:57:08 -0000 1.5 >++++ src/org/eclipse/pde/internal/runtime/logview/LogView.java 1 Jun 2011 14:59:33 -0000 >+@@ -87,6 +87,7 @@ >+ import org.eclipse.ui.IWorkbenchPage; >+ import org.eclipse.ui.PartInitException; >+ import org.eclipse.ui.PlatformUI; >++import org.eclipse.ui.XMLMemento; >+ import org.eclipse.ui.part.ViewPart; >+ >+ public class LogView extends ViewPart implements ILogListener { >+@@ -117,7 +118,7 @@ >+ >+ // private Clipboard fClipboard; >+ >+-// private IMemento fMemento; >++ private IMemento fMemento; >+ private File fInputFile; >+ private String fDirectory; >+ >+@@ -233,10 +234,10 @@ >+ private Action createActivateViewAction() { >+ Action action = new Action(PDERuntimeMessages.get().LogView_activate) { // >+ public void run() { >+-// fMemento.putString(P_ACTIVATE, isChecked() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >++ fMemento.putString(P_ACTIVATE, isChecked() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >+ } >+ }; >+-// action.setChecked(fMemento.getString(P_ACTIVATE).equals("true")); //$NON-NLS-1$ >++ action.setChecked(fMemento.getString(P_ACTIVATE).equals("true")); //$NON-NLS-1$ >+ return action; >+ } >+ >+@@ -391,7 +392,7 @@ >+ private void createColumns(Tree tree) { >+ fColumn1 = new TreeColumn(tree, SWT.LEFT); >+ fColumn1.setText(PDERuntimeMessages.get().LogView_column_message); >+-// fColumn1.setWidth(fMemento.getInteger(P_COLUMN_1).intValue()); >++ fColumn1.setWidth(fMemento.getInteger(P_COLUMN_1).intValue()); >+ fColumn1.setWidth(300); >+ fColumn1.addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+@@ -403,15 +404,15 @@ >+ setComparator(MESSAGE); >+ if (!isComparatorSet) >+ ((EventDetailsDialogAction) fPropertiesAction).setComparator(fComparator); >+-// fMemento.putInteger(P_ORDER_VALUE, MESSAGE_ORDER); >+-// fMemento.putInteger(P_ORDER_TYPE, MESSAGE); >++ fMemento.putInteger(P_ORDER_VALUE, MESSAGE_ORDER); >++ fMemento.putInteger(P_ORDER_TYPE, MESSAGE); >+ setColumnSorting(fColumn1, MESSAGE_ORDER); >+ } >+ }); >+ >+ fColumn2 = new TreeColumn(tree, SWT.LEFT); >+ fColumn2.setText(PDERuntimeMessages.get().LogView_column_plugin); >+-// fColumn2.setWidth(fMemento.getInteger(P_COLUMN_2).intValue()); >++ fColumn2.setWidth(fMemento.getInteger(P_COLUMN_2).intValue()); >+ fColumn2.setWidth(150); >+ fColumn2.addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+@@ -423,15 +424,15 @@ >+ setComparator(PLUGIN); >+ if (!isComparatorSet) >+ ((EventDetailsDialogAction) fPropertiesAction).setComparator(fComparator); >+-// fMemento.putInteger(P_ORDER_VALUE, PLUGIN_ORDER); >+-// fMemento.putInteger(P_ORDER_TYPE, PLUGIN); >++ fMemento.putInteger(P_ORDER_VALUE, PLUGIN_ORDER); >++ fMemento.putInteger(P_ORDER_TYPE, PLUGIN); >+ setColumnSorting(fColumn2, PLUGIN_ORDER); >+ } >+ }); >+ >+ fColumn3 = new TreeColumn(tree, SWT.LEFT); >+ fColumn3.setText(PDERuntimeMessages.get().LogView_column_date); >+-// fColumn3.setWidth(fMemento.getInteger(P_COLUMN_3).intValue()); >++ fColumn3.setWidth(fMemento.getInteger(P_COLUMN_3).intValue()); >+ fColumn3.setWidth(150); >+ fColumn3.addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+@@ -440,8 +441,8 @@ >+ fTreeViewer.setComparator(comparator); >+ setComparator(DATE); >+ ((EventDetailsDialogAction) fPropertiesAction).setComparator(fComparator); >+-// fMemento.putInteger(P_ORDER_VALUE, DATE_ORDER); >+-// fMemento.putInteger(P_ORDER_TYPE, DATE); >++ fMemento.putInteger(P_ORDER_VALUE, DATE_ORDER); >++ fMemento.putInteger(P_ORDER_TYPE, DATE); >+ setColumnSorting(fColumn3, DATE_ORDER); >+ } >+ }); >+@@ -450,15 +451,14 @@ >+ } >+ >+ private void initializeViewerSorter() { >+-// byte orderType = fMemento.getInteger(P_ORDER_TYPE).byteValue(); >+- byte orderType = DATE; >++ byte orderType = fMemento.getInteger(P_ORDER_TYPE).byteValue(); >+ ViewerComparator comparator = getViewerComparator(orderType); >+ fTreeViewer.setComparator(comparator); >+-// if (orderType == MESSAGE ) >+-// setColumnSorting(fColumn1, MESSAGE_ORDER); >+-// else if (orderType == PLUGIN) >+-// setColumnSorting(fColumn2, PLUGIN_ORDER); >+-// else if (orderType == DATE) >++ if (orderType == MESSAGE ) >++ setColumnSorting(fColumn1, MESSAGE_ORDER); >++ else if (orderType == PLUGIN) >++ setColumnSorting(fColumn2, PLUGIN_ORDER); >++ else if (orderType == DATE) >+ setColumnSorting(fColumn3, DATE_ORDER); >+ } >+ >+@@ -555,8 +555,7 @@ >+ } >+ >+ private void handleFilter() { >+- FilterDialog dialog = new FilterDialog(PDERuntimePlugin.getActiveWorkbenchShell(), null); >+-// FilterDialog dialog = new FilterDialog(PDERuntimePlugin.getActiveWorkbenchShell(), fMemento); >++ FilterDialog dialog = new FilterDialog(PDERuntimePlugin.getActiveWorkbenchShell(), fMemento); >+ dialog.create(); >+ dialog.getShell().setText(PDERuntimeMessages.get().LogView_FilterDialog_title); >+ if (dialog.open() == Window.OK) >+@@ -617,8 +616,7 @@ >+ fLogs.clear(); >+ if (!fInputFile.exists()) >+ return; >+- LogReader.parseLogFile(fInputFile, fLogs, null); >+-// LogReader.parseLogFile(fInputFile, fLogs, fMemento); >++ LogReader.parseLogFile(fInputFile, fLogs, fMemento); >+ } >+ >+ public void logging(IStatus status, String plugin) { >+@@ -635,8 +633,7 @@ >+ >+ private void pushStatus(IStatus status) { >+ LogEntry entry = new LogEntry(status); >+- LogReader.addEntry(entry, fLogs, null, true); >+-// LogReader.addEntry(entry, fLogs, fMemento, true); >++ LogReader.addEntry(entry, fLogs, fMemento, true); >+ asyncRefresh(); >+ } >+ >+@@ -714,78 +711,77 @@ >+ >+ public void init(IViewSite site, IMemento memento) throws PartInitException { >+ super.init(site, memento); >+-// if (memento == null) >+-// this.fMemento = XMLMemento.createWriteRoot("LOGVIEW"); //$NON-NLS-1$ >+-// else >+-// this.fMemento = memento; >+-// readSettings(); >+- >+- // initialize column ordering >+-// final byte type = this.fMemento.getInteger(P_ORDER_TYPE).byteValue(); >+-// switch (type){ >+-// case DATE: >+-// DATE_ORDER = this.fMemento.getInteger(P_ORDER_VALUE).intValue(); >+-// MESSAGE_ORDER = DESCENDING; >+-// PLUGIN_ORDER = DESCENDING; >+-// break; >+-// case MESSAGE: >+-// MESSAGE_ORDER = this.fMemento.getInteger(P_ORDER_VALUE).intValue(); >+-// DATE_ORDER = DESCENDING; >+-// PLUGIN_ORDER = DESCENDING; >+-// break; >+-// case PLUGIN: >+-// PLUGIN_ORDER = this.fMemento.getInteger(P_ORDER_VALUE).intValue(); >+-// MESSAGE_ORDER = DESCENDING; >+-// DATE_ORDER = DESCENDING; >+-// break; >+-// default: >++ if (memento == null) >++ this.fMemento = XMLMemento.createWriteRoot("LOGVIEW"); //$NON-NLS-1$ >++ else >++ this.fMemento = memento; >++ readSettings(); >++ >++// initialize column ordering >++ final byte type = this.fMemento.getInteger(P_ORDER_TYPE).byteValue(); >++ switch (type){ >++ case DATE: >++ DATE_ORDER = this.fMemento.getInteger(P_ORDER_VALUE).intValue(); >++ MESSAGE_ORDER = DESCENDING; >++ PLUGIN_ORDER = DESCENDING; >++ break; >++ case MESSAGE: >++ MESSAGE_ORDER = this.fMemento.getInteger(P_ORDER_VALUE).intValue(); >++ DATE_ORDER = DESCENDING; >++ PLUGIN_ORDER = DESCENDING; >++ break; >++ case PLUGIN: >++ PLUGIN_ORDER = this.fMemento.getInteger(P_ORDER_VALUE).intValue(); >++ MESSAGE_ORDER = DESCENDING; >++ DATE_ORDER = DESCENDING; >++ break; >++ default: >+ DATE_ORDER = DESCENDING; >+ MESSAGE_ORDER = DESCENDING; >+ PLUGIN_ORDER = DESCENDING; >+-// } >+-// setComparator(fMemento.getInteger(P_ORDER_TYPE).byteValue()); >+- setComparator(DATE); >++ } >++ setComparator(fMemento.getInteger(P_ORDER_TYPE).byteValue()); >+ } >+ >+ private void initializeMemento() { >+-// if (fMemento.getString(P_USE_LIMIT) == null) >+-// fMemento.putString(P_USE_LIMIT, "true"); //$NON-NLS-1$ >+-// if (fMemento.getInteger(P_LOG_LIMIT) == null) >+-// fMemento.putInteger(P_LOG_LIMIT, 50); >+-// if (fMemento.getString(P_LOG_INFO) == null) >+-// fMemento.putString(P_LOG_INFO, "true"); //$NON-NLS-1$ >+-// if (fMemento.getString(P_LOG_WARNING) == null) >+-// fMemento.putString(P_LOG_WARNING, "true"); //$NON-NLS-1$ >+-// if (fMemento.getString(P_LOG_ERROR) == null) >+-// fMemento.putString(P_LOG_ERROR, "true"); //$NON-NLS-1$ >+-// if (fMemento.getString(P_SHOW_ALL_SESSIONS) == null) >+-// fMemento.putString(P_SHOW_ALL_SESSIONS, "true"); //$NON-NLS-1$ >+-// Integer width = fMemento.getInteger(P_COLUMN_1); >+-// if (width == null || width.intValue() == 0) >+-// fMemento.putInteger(P_COLUMN_1, 300); >+-// width = fMemento.getInteger(P_COLUMN_2); >+-// if (width == null || width.intValue() == 0) >+-// fMemento.putInteger(P_COLUMN_2, 150); >+-// width = fMemento.getInteger(P_COLUMN_3); >+-// if (width == null || width.intValue() == 0) >+-// fMemento.putInteger(P_COLUMN_3, 150); >+-// if (fMemento.getString(P_ACTIVATE) == null) >+-// fMemento.putString(P_ACTIVATE, "true"); //$NON-NLS-1$ >+-// >+-// fMemento.putInteger(P_ORDER_VALUE, DESCENDING); >+-// fMemento.putInteger(P_ORDER_TYPE, DATE); >++ if (fMemento.getString(P_USE_LIMIT) == null) >++ fMemento.putString(P_USE_LIMIT, "true"); //$NON-NLS-1$ >++ if (fMemento.getInteger(P_LOG_LIMIT) == null) >++ fMemento.putInteger(P_LOG_LIMIT, 50); >++ if (fMemento.getString(P_LOG_INFO) == null) >++ fMemento.putString(P_LOG_INFO, "true"); //$NON-NLS-1$ >++ if (fMemento.getString(P_LOG_WARNING) == null) >++ fMemento.putString(P_LOG_WARNING, "true"); //$NON-NLS-1$ >++ if (fMemento.getString(P_LOG_ERROR) == null) >++ fMemento.putString(P_LOG_ERROR, "true"); //$NON-NLS-1$ >++ if (fMemento.getString(P_SHOW_ALL_SESSIONS) == null) >++ fMemento.putString(P_SHOW_ALL_SESSIONS, "true"); //$NON-NLS-1$ >++ Integer width = fMemento.getInteger(P_COLUMN_1); >++ if (width == null || width.intValue() == 0) >++ fMemento.putInteger(P_COLUMN_1, 300); >++ width = fMemento.getInteger(P_COLUMN_2); >++ if (width == null || width.intValue() == 0) >++ fMemento.putInteger(P_COLUMN_2, 150); >++ width = fMemento.getInteger(P_COLUMN_3); >++ if (width == null || width.intValue() == 0) >++ fMemento.putInteger(P_COLUMN_3, 150); >++ if (fMemento.getString(P_ACTIVATE) == null) >++ fMemento.putString(P_ACTIVATE, "true"); //$NON-NLS-1$ >++ >++ fMemento.putInteger(P_ORDER_VALUE, DESCENDING); >++ fMemento.putInteger(P_ORDER_TYPE, DATE); >+ } >+ >+ public void saveState(IMemento memento) { >+-// if (this.fMemento == null || memento == null) >+-// return; >+-// this.fMemento.putInteger(P_COLUMN_1, fColumn1.getWidth()); >+-// this.fMemento.putInteger(P_COLUMN_2, fColumn2.getWidth()); >+-// this.fMemento.putInteger(P_COLUMN_3, fColumn3.getWidth()); >+-// this.fMemento.putString(P_ACTIVATE, >+-// fActivateViewAction.isChecked() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >+-// memento.putMemento(this.fMemento); >+-// writeSettings(); >++ if (this.fMemento == null || memento == null) >++ return; >++ this.fMemento.putInteger(P_COLUMN_1, fColumn1.getWidth()); >++ this.fMemento.putInteger(P_COLUMN_2, fColumn2.getWidth()); >++ this.fMemento.putInteger(P_COLUMN_3, fColumn3.getWidth()); >++ this.fMemento.putString(P_ACTIVATE, >++ fActivateViewAction.isChecked() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >++ memento.putMemento(this.fMemento); >++ writeSettings(); >+ } >+ >+ private void addMouseListeners() { >+@@ -1019,26 +1015,26 @@ >+ return; >+ } >+ try { >+-// fMemento.putString(P_USE_LIMIT, s.getBoolean(P_USE_LIMIT) ? "true":"false"); //$NON-NLS-1$ //$NON-NLS-2$ >+-// fMemento.putString(P_LOG_INFO, s.getBoolean(P_LOG_INFO) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >+-// fMemento.putString(P_LOG_WARNING, s.getBoolean(P_LOG_WARNING) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >+-// fMemento.putString(P_LOG_ERROR, s.getBoolean(P_LOG_ERROR) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >+-// fMemento.putString(P_SHOW_ALL_SESSIONS, s.getBoolean(P_SHOW_ALL_SESSIONS) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >+-// fMemento.putInteger(P_LOG_LIMIT, s.getInt(P_LOG_LIMIT)); >+-// fMemento.putInteger(P_COLUMN_1, p.getInt(P_COLUMN_1) > 0 ? p.getInt(P_COLUMN_1) : 300); >+-// fMemento.putInteger(P_COLUMN_2, p.getInt(P_COLUMN_2) > 0 ? p.getInt(P_COLUMN_2) : 150); >+-// fMemento.putInteger(P_COLUMN_3, p.getInt(P_COLUMN_3) > 0 ? p.getInt(P_COLUMN_3) : 150); >+-// fMemento.putString(P_ACTIVATE, p.getBoolean(P_ACTIVATE) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >+-// int order = p.getInt(P_ORDER_VALUE); >+-// fMemento.putInteger(P_ORDER_VALUE, order == 0 ? DESCENDING : order); >+-// fMemento.putInteger(P_ORDER_TYPE, p.getInt(P_ORDER_TYPE)); >++ fMemento.putString(P_USE_LIMIT, s.getBoolean(P_USE_LIMIT) ? "true":"false"); //$NON-NLS-1$ //$NON-NLS-2$ >++ fMemento.putString(P_LOG_INFO, s.getBoolean(P_LOG_INFO) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >++ fMemento.putString(P_LOG_WARNING, s.getBoolean(P_LOG_WARNING) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >++ fMemento.putString(P_LOG_ERROR, s.getBoolean(P_LOG_ERROR) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >++ fMemento.putString(P_SHOW_ALL_SESSIONS, s.getBoolean(P_SHOW_ALL_SESSIONS) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >++ fMemento.putInteger(P_LOG_LIMIT, s.getInt(P_LOG_LIMIT)); >++ fMemento.putInteger(P_COLUMN_1, p.getInt(P_COLUMN_1) > 0 ? p.getInt(P_COLUMN_1) : 300); >++ fMemento.putInteger(P_COLUMN_2, p.getInt(P_COLUMN_2) > 0 ? p.getInt(P_COLUMN_2) : 150); >++ fMemento.putInteger(P_COLUMN_3, p.getInt(P_COLUMN_3) > 0 ? p.getInt(P_COLUMN_3) : 150); >++ fMemento.putString(P_ACTIVATE, p.getBoolean(P_ACTIVATE) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >++ int order = p.getInt(P_ORDER_VALUE); >++ fMemento.putInteger(P_ORDER_VALUE, order == 0 ? DESCENDING : order); >++ fMemento.putInteger(P_ORDER_TYPE, p.getInt(P_ORDER_TYPE)); >+ } catch (NumberFormatException e) { >+-// fMemento.putInteger(P_LOG_LIMIT, 50); >+-// fMemento.putInteger(P_COLUMN_1, 300); >+-// fMemento.putInteger(P_COLUMN_2, 150); >+-// fMemento.putInteger(P_COLUMN_3, 150); >+-// fMemento.putInteger(P_ORDER_TYPE, DATE); >+-// fMemento.putInteger(P_ORDER_VALUE, DESCENDING); >++ fMemento.putInteger(P_LOG_LIMIT, 50); >++ fMemento.putInteger(P_COLUMN_1, 300); >++ fMemento.putInteger(P_COLUMN_2, 150); >++ fMemento.putInteger(P_COLUMN_3, 150); >++ fMemento.putInteger(P_ORDER_TYPE, DATE); >++ fMemento.putInteger(P_ORDER_VALUE, DESCENDING); >+ } >+ } >+ >+@@ -1051,23 +1047,23 @@ >+ IDialogSettings settings = getLogSettings(); >+ if (settings == null) >+ settings = PDERuntimePlugin.getDefault().getDialogSettings().addNewSection(getClass().getName()); >+-// settings.put(P_USE_LIMIT, fMemento.getString(P_USE_LIMIT).equals("true")); //$NON-NLS-1$ >+-// settings.put(P_LOG_LIMIT, fMemento.getInteger(P_LOG_LIMIT).intValue()); >+-// settings.put(P_LOG_INFO, fMemento.getString(P_LOG_INFO).equals("true")); //$NON-NLS-1$ >+-// settings.put(P_LOG_WARNING, fMemento.getString(P_LOG_WARNING).equals("true")); //$NON-NLS-1$ >+-// settings.put(P_LOG_ERROR, fMemento.getString(P_LOG_ERROR).equals("true")); //$NON-NLS-1$ >+-// settings.put(P_SHOW_ALL_SESSIONS, fMemento.getString(P_SHOW_ALL_SESSIONS).equals("true")); //$NON-NLS-1$ >++ settings.put(P_USE_LIMIT, fMemento.getString(P_USE_LIMIT).equals("true")); //$NON-NLS-1$ >++ settings.put(P_LOG_LIMIT, fMemento.getInteger(P_LOG_LIMIT).intValue()); >++ settings.put(P_LOG_INFO, fMemento.getString(P_LOG_INFO).equals("true")); //$NON-NLS-1$ >++ settings.put(P_LOG_WARNING, fMemento.getString(P_LOG_WARNING).equals("true")); //$NON-NLS-1$ >++ settings.put(P_LOG_ERROR, fMemento.getString(P_LOG_ERROR).equals("true")); //$NON-NLS-1$ >++ settings.put(P_SHOW_ALL_SESSIONS, fMemento.getString(P_SHOW_ALL_SESSIONS).equals("true")); //$NON-NLS-1$ >+ } >+ >+ private void writeViewSettings(){ >+ Preferences preferences = getLogPreferences(); >+-// preferences.setValue(P_COLUMN_1, fMemento.getInteger(P_COLUMN_1).intValue()); >+-// preferences.setValue(P_COLUMN_2, fMemento.getInteger(P_COLUMN_2).intValue()); >+-// preferences.setValue(P_COLUMN_3, fMemento.getInteger(P_COLUMN_3).intValue()); >+-// preferences.setValue(P_ACTIVATE, fMemento.getString(P_ACTIVATE).equals("true")); //$NON-NLS-1$ >+-// int order = fMemento.getInteger(P_ORDER_VALUE).intValue(); >+-// preferences.setValue(P_ORDER_VALUE, order == 0 ? DESCENDING : order); >+-// preferences.setValue(P_ORDER_TYPE, fMemento.getInteger(P_ORDER_TYPE).intValue()); >++ preferences.setValue(P_COLUMN_1, fMemento.getInteger(P_COLUMN_1).intValue()); >++ preferences.setValue(P_COLUMN_2, fMemento.getInteger(P_COLUMN_2).intValue()); >++ preferences.setValue(P_COLUMN_3, fMemento.getInteger(P_COLUMN_3).intValue()); >++ preferences.setValue(P_ACTIVATE, fMemento.getString(P_ACTIVATE).equals("true")); //$NON-NLS-1$ >++ int order = fMemento.getInteger(P_ORDER_VALUE).intValue(); >++ preferences.setValue(P_ORDER_VALUE, order == 0 ? DESCENDING : order); >++ preferences.setValue(P_ORDER_TYPE, fMemento.getInteger(P_ORDER_TYPE).intValue()); >+ } >+ >+ public void sortByDateDescending() { >+@@ -1075,10 +1071,11 @@ >+ } >+ >+ protected Job getOpenLogFileJob() { >++ final Display display=Display.getDefault(); >+ final Shell shell = getViewSite().getShell(); >+ return new Job(PDERuntimeMessages.get().OpenLogDialog_message) { >+ protected IStatus run(IProgressMonitor monitor) { >+- boolean failed = false; >++ boolean failed = true; >+ if (fInputFile.length() <= LogReader.MAX_FILE_LENGTH) { >+ // failed = !Program.launch(fInputFile.getAbsolutePath()); >+ // if (failed) { >+@@ -1091,7 +1088,7 @@ >+ } >+ if (failed) { >+ final OpenLogDialog openDialog = new OpenLogDialog(shell, fInputFile); >+- Display.getDefault().asyncExec(new Runnable() { >++ display.asyncExec(new Runnable() { >+ public void run() { >+ openDialog.create(); >+ openDialog.open(); >Index: src/org/eclipse/pde/internal/runtime/PDERuntimePlugin.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/sandbox/org.eclipse.rap.pde.runtime/src/org/eclipse/pde/internal/runtime/PDERuntimePlugin.java,v >retrieving revision 1.1 >diff -u -r1.1 PDERuntimePlugin.java >--- src/org/eclipse/pde/internal/runtime/PDERuntimePlugin.java 27 Sep 2007 09:44:44 -0000 1.1 >+++ src/org/eclipse/pde/internal/runtime/PDERuntimePlugin.java 5 Jun 2011 16:41:04 -0000 >@@ -10,6 +10,8 @@ > *******************************************************************************/ > package org.eclipse.pde.internal.runtime; > >+import org.eclipse.pde.internal.runtime.logview.DownloadServiceHandler; >+import org.eclipse.rwt.RWT; > import org.eclipse.swt.widgets.Shell; > import org.eclipse.ui.IWorkbenchPage; > import org.eclipse.ui.IWorkbenchWindow; >@@ -19,7 +21,11 @@ > > public class PDERuntimePlugin extends AbstractUIPlugin { > >+ public static final String DOWNLOAD_SERVICE_HANDLER_ID = "downloadLogFile"; //$NON-NLS-1$ >+ > private static PDERuntimePlugin inst; >+ >+ private DownloadServiceHandler fDownloadServiceHandler; > > private BundleContext fContext; > >@@ -56,6 +62,8 @@ > public void start(BundleContext context) throws Exception { > super.start(context); > this.fContext = context; >+ fDownloadServiceHandler=new DownloadServiceHandler(); >+ RWT.getServiceManager().registerServiceHandler(DOWNLOAD_SERVICE_HANDLER_ID, fDownloadServiceHandler); > } > > public BundleContext getBundleContext() { >@@ -68,6 +76,7 @@ > public void stop(BundleContext context) throws Exception { > super.stop(context); > inst = null; >+ RWT.getServiceManager().unregisterServiceHandler(DOWNLOAD_SERVICE_HANDLER_ID); > } > > } >Index: src/org/eclipse/pde/internal/runtime/logview/DownloadServiceHandler.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/runtime/logview/DownloadServiceHandler.java >diff -N src/org/eclipse/pde/internal/runtime/logview/DownloadServiceHandler.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/runtime/logview/DownloadServiceHandler.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,61 @@ >+/** >+ * >+ */ >+package org.eclipse.pde.internal.runtime.logview; >+ >+import java.io.File; >+import java.io.FileInputStream; >+import java.io.IOException; >+import java.io.InputStream; >+ >+import javax.servlet.ServletException; >+import javax.servlet.http.HttpServletResponse; >+ >+import org.eclipse.core.runtime.Platform; >+import org.eclipse.jface.dialogs.MessageDialog; >+import org.eclipse.pde.internal.runtime.PDERuntimeMessages; >+import org.eclipse.pde.internal.runtime.PDERuntimePlugin; >+import org.eclipse.rwt.RWT; >+import org.eclipse.rwt.service.IServiceHandler; >+ >+/** >+ * {@link IServiceHandler} implementation allowing to download platform log file >+ * >+ */ >+public class DownloadServiceHandler implements IServiceHandler { >+ >+ /** >+ * @see org.eclipse.rwt.service.IServiceHandler#service() >+ */ >+ public void service() throws IOException, ServletException { >+ File inputFile=Platform.getLogFileLocation().toFile(); >+ // Send the file in the response >+ HttpServletResponse response = RWT.getResponse(); >+ response.setContentType( "application/octet-stream" ); >+ response.setContentLength((int) inputFile.length() ); >+ String fileName=inputFile.getName(); >+ if(fileName.charAt(0)=='.'){ >+ fileName="pde" + fileName; >+ } >+ String contentDisposition = "attachment; filename=\"" + fileName + '\"'; >+ response.setHeader( "Content-Disposition", contentDisposition ); >+ InputStream inputStream=null; >+ try { >+ inputStream=new FileInputStream(inputFile); >+ int b=inputStream.read(); >+ while (b!=-1){ >+ response.getOutputStream().write( b ); >+ b=inputStream.read(); >+ } >+ >+ } catch( IOException e1 ) { >+ MessageDialog.openError(PDERuntimePlugin.getActiveWorkbenchShell(), PDERuntimeMessages.get().LogView_exportLog, e1.toString()); >+ }finally{ >+ if(inputStream!=null){ >+ inputStream.close(); >+ } >+ } >+ >+ } >+ >+} >Index: src/org/eclipse/pde/internal/runtime/logview/LogReader.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/sandbox/org.eclipse.rap.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogReader.java,v >retrieving revision 1.2 >diff -u -r1.2 LogReader.java >--- src/org/eclipse/pde/internal/runtime/logview/LogReader.java 10 Oct 2007 12:28:06 -0000 1.2 >+++ src/org/eclipse/pde/internal/runtime/logview/LogReader.java 5 Jun 2011 16:41:05 -0000 >@@ -20,6 +20,7 @@ > import java.util.ArrayList; > import java.util.Date; > >+import org.eclipse.core.runtime.IStatus; > import org.eclipse.ui.IMemento; > > class LogReader { >@@ -102,7 +103,7 @@ > writer = new PrintWriter(swriter, true); > writerState = SESSION_STATE; > updateCurrentSession(session); >- if (!currentSession.equals(session) /*&& !memento.getString(LogView.P_SHOW_ALL_SESSIONS).equals("true")*/) //$NON-NLS-1$ >+ if (!currentSession.equals(session) && !memento.getString(LogView.P_SHOW_ALL_SESSIONS).equals("true")) //$NON-NLS-1$ > entries.clear(); > } else if (state == ENTRY_STATE) { > LogEntry entry = new LogEntry(); >@@ -167,25 +168,25 @@ > public synchronized static void addEntry(LogEntry current, ArrayList entries, IMemento memento, boolean useCurrentSession) { > int severity = current.getSeverity(); > boolean doAdd = true; >-// switch(severity) { >-// case IStatus.INFO: >-// doAdd = memento.getString(LogView.P_LOG_INFO).equals("true"); //$NON-NLS-1$ >-// break; >-// case IStatus.WARNING: >-// doAdd = memento.getString(LogView.P_LOG_WARNING).equals("true"); //$NON-NLS-1$ >-// break; >-// case IStatus.ERROR: >-// doAdd = memento.getString(LogView.P_LOG_ERROR).equals("true"); //$NON-NLS-1$ >-// break; >-// } >+ switch(severity) { >+ case IStatus.INFO: >+ doAdd = memento.getString(LogView.P_LOG_INFO).equals("true"); //$NON-NLS-1$ >+ break; >+ case IStatus.WARNING: >+ doAdd = memento.getString(LogView.P_LOG_WARNING).equals("true"); //$NON-NLS-1$ >+ break; >+ case IStatus.ERROR: >+ doAdd = memento.getString(LogView.P_LOG_ERROR).equals("true"); //$NON-NLS-1$ >+ break; >+ } > if (doAdd) { > if (useCurrentSession) > current.setSession(currentSession); > entries.add(0, current); > >-// if (memento.getString(LogView.P_USE_LIMIT).equals("true") //$NON-NLS-1$ >-// && entries.size() > memento.getInteger(LogView.P_LOG_LIMIT).intValue()) >-// entries.remove(entries.size() - 1); >+ if (memento.getString(LogView.P_USE_LIMIT).equals("true") //$NON-NLS-1$ >+ && entries.size() > memento.getInteger(LogView.P_LOG_LIMIT).intValue()) >+ entries.remove(entries.size() - 1); > } > } > >Index: src/org/eclipse/pde/internal/runtime/logview/LogView.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/sandbox/org.eclipse.rap.pde.runtime/src/org/eclipse/pde/internal/runtime/logview/LogView.java,v >retrieving revision 1.5 >diff -u -r1.5 LogView.java >--- src/org/eclipse/pde/internal/runtime/logview/LogView.java 11 Dec 2007 14:57:08 -0000 1.5 >+++ src/org/eclipse/pde/internal/runtime/logview/LogView.java 5 Jun 2011 16:41:06 -0000 >@@ -58,6 +58,9 @@ > import org.eclipse.pde.internal.runtime.PDERuntimeMessages; > import org.eclipse.pde.internal.runtime.PDERuntimePlugin; > import org.eclipse.pde.internal.runtime.PDERuntimePluginImages; >+import org.eclipse.rwt.RWT; >+import org.eclipse.rwt.service.IServiceHandler; >+import org.eclipse.rwt.widgets.ExternalBrowser; > import org.eclipse.swt.SWT; > import org.eclipse.swt.custom.BusyIndicator; > import org.eclipse.swt.events.DisposeEvent; >@@ -73,6 +76,7 @@ > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Display; > import org.eclipse.swt.widgets.Event; >+import org.eclipse.swt.widgets.FileDialog; > import org.eclipse.swt.widgets.Menu; > import org.eclipse.swt.widgets.Shell; > import org.eclipse.swt.widgets.Text; >@@ -87,6 +91,7 @@ > import org.eclipse.ui.IWorkbenchPage; > import org.eclipse.ui.PartInitException; > import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.XMLMemento; > import org.eclipse.ui.part.ViewPart; > > public class LogView extends ViewPart implements ILogListener { >@@ -117,7 +122,7 @@ > > // private Clipboard fClipboard; > >-// private IMemento fMemento; >+ private IMemento fMemento; > private File fInputFile; > private String fDirectory; > >@@ -233,10 +238,10 @@ > private Action createActivateViewAction() { > Action action = new Action(PDERuntimeMessages.get().LogView_activate) { // > public void run() { >-// fMemento.putString(P_ACTIVATE, isChecked() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >+ fMemento.putString(P_ACTIVATE, isChecked() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ > } > }; >-// action.setChecked(fMemento.getString(P_ACTIVATE).equals("true")); //$NON-NLS-1$ >+ action.setChecked(fMemento.getString(P_ACTIVATE).equals("true")); //$NON-NLS-1$ > return action; > } > >@@ -391,7 +396,7 @@ > private void createColumns(Tree tree) { > fColumn1 = new TreeColumn(tree, SWT.LEFT); > fColumn1.setText(PDERuntimeMessages.get().LogView_column_message); >-// fColumn1.setWidth(fMemento.getInteger(P_COLUMN_1).intValue()); >+ fColumn1.setWidth(fMemento.getInteger(P_COLUMN_1).intValue()); > fColumn1.setWidth(300); > fColumn1.addSelectionListener(new SelectionAdapter() { > public void widgetSelected(SelectionEvent e) { >@@ -403,15 +408,15 @@ > setComparator(MESSAGE); > if (!isComparatorSet) > ((EventDetailsDialogAction) fPropertiesAction).setComparator(fComparator); >-// fMemento.putInteger(P_ORDER_VALUE, MESSAGE_ORDER); >-// fMemento.putInteger(P_ORDER_TYPE, MESSAGE); >+ fMemento.putInteger(P_ORDER_VALUE, MESSAGE_ORDER); >+ fMemento.putInteger(P_ORDER_TYPE, MESSAGE); > setColumnSorting(fColumn1, MESSAGE_ORDER); > } > }); > > fColumn2 = new TreeColumn(tree, SWT.LEFT); > fColumn2.setText(PDERuntimeMessages.get().LogView_column_plugin); >-// fColumn2.setWidth(fMemento.getInteger(P_COLUMN_2).intValue()); >+ fColumn2.setWidth(fMemento.getInteger(P_COLUMN_2).intValue()); > fColumn2.setWidth(150); > fColumn2.addSelectionListener(new SelectionAdapter() { > public void widgetSelected(SelectionEvent e) { >@@ -423,15 +428,15 @@ > setComparator(PLUGIN); > if (!isComparatorSet) > ((EventDetailsDialogAction) fPropertiesAction).setComparator(fComparator); >-// fMemento.putInteger(P_ORDER_VALUE, PLUGIN_ORDER); >-// fMemento.putInteger(P_ORDER_TYPE, PLUGIN); >+ fMemento.putInteger(P_ORDER_VALUE, PLUGIN_ORDER); >+ fMemento.putInteger(P_ORDER_TYPE, PLUGIN); > setColumnSorting(fColumn2, PLUGIN_ORDER); > } > }); > > fColumn3 = new TreeColumn(tree, SWT.LEFT); > fColumn3.setText(PDERuntimeMessages.get().LogView_column_date); >-// fColumn3.setWidth(fMemento.getInteger(P_COLUMN_3).intValue()); >+ fColumn3.setWidth(fMemento.getInteger(P_COLUMN_3).intValue()); > fColumn3.setWidth(150); > fColumn3.addSelectionListener(new SelectionAdapter() { > public void widgetSelected(SelectionEvent e) { >@@ -440,8 +445,8 @@ > fTreeViewer.setComparator(comparator); > setComparator(DATE); > ((EventDetailsDialogAction) fPropertiesAction).setComparator(fComparator); >-// fMemento.putInteger(P_ORDER_VALUE, DATE_ORDER); >-// fMemento.putInteger(P_ORDER_TYPE, DATE); >+ fMemento.putInteger(P_ORDER_VALUE, DATE_ORDER); >+ fMemento.putInteger(P_ORDER_TYPE, DATE); > setColumnSorting(fColumn3, DATE_ORDER); > } > }); >@@ -450,15 +455,14 @@ > } > > private void initializeViewerSorter() { >-// byte orderType = fMemento.getInteger(P_ORDER_TYPE).byteValue(); >- byte orderType = DATE; >+ byte orderType = fMemento.getInteger(P_ORDER_TYPE).byteValue(); > ViewerComparator comparator = getViewerComparator(orderType); > fTreeViewer.setComparator(comparator); >-// if (orderType == MESSAGE ) >-// setColumnSorting(fColumn1, MESSAGE_ORDER); >-// else if (orderType == PLUGIN) >-// setColumnSorting(fColumn2, PLUGIN_ORDER); >-// else if (orderType == DATE) >+ if (orderType == MESSAGE ) >+ setColumnSorting(fColumn1, MESSAGE_ORDER); >+ else if (orderType == PLUGIN) >+ setColumnSorting(fColumn2, PLUGIN_ORDER); >+ else if (orderType == DATE) > setColumnSorting(fColumn3, DATE_ORDER); > } > >@@ -480,11 +484,11 @@ > > > private void handleImport() { >-// FileDialog dialog = new FileDialog(getViewSite().getShell()); >-// dialog.setFilterExtensions(new String[] { "*.log" }); //$NON-NLS-1$ >-// if (fDirectory != null) >-// dialog.setFilterPath(fDirectory); >-// handleImportPath(dialog.open()); >+ FileDialog dialog = new FileDialog(getViewSite().getShell()); >+ dialog.setFilterExtensions(new String[] { "*.log" }); //$NON-NLS-1$ >+ if (fDirectory != null) >+ dialog.setFilterPath(fDirectory); >+ handleImportPath(dialog.open()); > } > > public void handleImportPath(String path) { >@@ -524,12 +528,22 @@ > // File outputFile = new Path(path).toFile(); > // fDirectory = outputFile.getParent(); > // if (outputFile.exists()) { >-// String message = NLS.bind(PDERuntimeMessages.LogView_confirmOverwrite_message, outputFile.toString()); >-// if (!MessageDialog.openQuestion(getViewSite().getShell(), PDERuntimeMessages.LogView_exportLog, message)) >+// String message = PDERuntimeMessages.get().LogView_confirmOverwrite_message; >+// if (!MessageDialog.openQuestion(getViewSite().getShell(), PDERuntimeMessages.get().LogView_exportLog, message)) > // return; > // } > // copy(fInputFile, outputFile); > // } >+ >+ StringBuilder url = new StringBuilder(); >+ url.append( RWT.getRequest().getContextPath() ); >+ url.append( RWT.getRequest().getServletPath() ); >+ url.append( '?' ); >+ url.append( IServiceHandler.REQUEST_PARAM ); >+ url.append( '=' ).append(PDERuntimePlugin.DOWNLOAD_SERVICE_HANDLER_ID); >+ String encodedURL = RWT.getResponse().encodeURL( url.toString() ); >+ >+ ExternalBrowser.open(PDERuntimePlugin.DOWNLOAD_SERVICE_HANDLER_ID, encodedURL, SWT.NONE); > } > > private void copy(File inputFile, File outputFile) { >@@ -555,8 +569,7 @@ > } > > private void handleFilter() { >- FilterDialog dialog = new FilterDialog(PDERuntimePlugin.getActiveWorkbenchShell(), null); >-// FilterDialog dialog = new FilterDialog(PDERuntimePlugin.getActiveWorkbenchShell(), fMemento); >+ FilterDialog dialog = new FilterDialog(PDERuntimePlugin.getActiveWorkbenchShell(), fMemento); > dialog.create(); > dialog.getShell().setText(PDERuntimeMessages.get().LogView_FilterDialog_title); > if (dialog.open() == Window.OK) >@@ -617,8 +630,7 @@ > fLogs.clear(); > if (!fInputFile.exists()) > return; >- LogReader.parseLogFile(fInputFile, fLogs, null); >-// LogReader.parseLogFile(fInputFile, fLogs, fMemento); >+ LogReader.parseLogFile(fInputFile, fLogs, fMemento); > } > > public void logging(IStatus status, String plugin) { >@@ -635,8 +647,7 @@ > > private void pushStatus(IStatus status) { > LogEntry entry = new LogEntry(status); >- LogReader.addEntry(entry, fLogs, null, true); >-// LogReader.addEntry(entry, fLogs, fMemento, true); >+ LogReader.addEntry(entry, fLogs, fMemento, true); > asyncRefresh(); > } > >@@ -714,78 +725,77 @@ > > public void init(IViewSite site, IMemento memento) throws PartInitException { > super.init(site, memento); >-// if (memento == null) >-// this.fMemento = XMLMemento.createWriteRoot("LOGVIEW"); //$NON-NLS-1$ >-// else >-// this.fMemento = memento; >-// readSettings(); >- >- // initialize column ordering >-// final byte type = this.fMemento.getInteger(P_ORDER_TYPE).byteValue(); >-// switch (type){ >-// case DATE: >-// DATE_ORDER = this.fMemento.getInteger(P_ORDER_VALUE).intValue(); >-// MESSAGE_ORDER = DESCENDING; >-// PLUGIN_ORDER = DESCENDING; >-// break; >-// case MESSAGE: >-// MESSAGE_ORDER = this.fMemento.getInteger(P_ORDER_VALUE).intValue(); >-// DATE_ORDER = DESCENDING; >-// PLUGIN_ORDER = DESCENDING; >-// break; >-// case PLUGIN: >-// PLUGIN_ORDER = this.fMemento.getInteger(P_ORDER_VALUE).intValue(); >-// MESSAGE_ORDER = DESCENDING; >-// DATE_ORDER = DESCENDING; >-// break; >-// default: >+ if (memento == null) >+ this.fMemento = XMLMemento.createWriteRoot("LOGVIEW"); //$NON-NLS-1$ >+ else >+ this.fMemento = memento; >+ readSettings(); >+ >+// initialize column ordering >+ final byte type = this.fMemento.getInteger(P_ORDER_TYPE).byteValue(); >+ switch (type){ >+ case DATE: >+ DATE_ORDER = this.fMemento.getInteger(P_ORDER_VALUE).intValue(); >+ MESSAGE_ORDER = DESCENDING; >+ PLUGIN_ORDER = DESCENDING; >+ break; >+ case MESSAGE: >+ MESSAGE_ORDER = this.fMemento.getInteger(P_ORDER_VALUE).intValue(); >+ DATE_ORDER = DESCENDING; >+ PLUGIN_ORDER = DESCENDING; >+ break; >+ case PLUGIN: >+ PLUGIN_ORDER = this.fMemento.getInteger(P_ORDER_VALUE).intValue(); >+ MESSAGE_ORDER = DESCENDING; >+ DATE_ORDER = DESCENDING; >+ break; >+ default: > DATE_ORDER = DESCENDING; > MESSAGE_ORDER = DESCENDING; > PLUGIN_ORDER = DESCENDING; >-// } >-// setComparator(fMemento.getInteger(P_ORDER_TYPE).byteValue()); >- setComparator(DATE); >+ } >+ setComparator(fMemento.getInteger(P_ORDER_TYPE).byteValue()); > } > > private void initializeMemento() { >-// if (fMemento.getString(P_USE_LIMIT) == null) >-// fMemento.putString(P_USE_LIMIT, "true"); //$NON-NLS-1$ >-// if (fMemento.getInteger(P_LOG_LIMIT) == null) >-// fMemento.putInteger(P_LOG_LIMIT, 50); >-// if (fMemento.getString(P_LOG_INFO) == null) >-// fMemento.putString(P_LOG_INFO, "true"); //$NON-NLS-1$ >-// if (fMemento.getString(P_LOG_WARNING) == null) >-// fMemento.putString(P_LOG_WARNING, "true"); //$NON-NLS-1$ >-// if (fMemento.getString(P_LOG_ERROR) == null) >-// fMemento.putString(P_LOG_ERROR, "true"); //$NON-NLS-1$ >-// if (fMemento.getString(P_SHOW_ALL_SESSIONS) == null) >-// fMemento.putString(P_SHOW_ALL_SESSIONS, "true"); //$NON-NLS-1$ >-// Integer width = fMemento.getInteger(P_COLUMN_1); >-// if (width == null || width.intValue() == 0) >-// fMemento.putInteger(P_COLUMN_1, 300); >-// width = fMemento.getInteger(P_COLUMN_2); >-// if (width == null || width.intValue() == 0) >-// fMemento.putInteger(P_COLUMN_2, 150); >-// width = fMemento.getInteger(P_COLUMN_3); >-// if (width == null || width.intValue() == 0) >-// fMemento.putInteger(P_COLUMN_3, 150); >-// if (fMemento.getString(P_ACTIVATE) == null) >-// fMemento.putString(P_ACTIVATE, "true"); //$NON-NLS-1$ >-// >-// fMemento.putInteger(P_ORDER_VALUE, DESCENDING); >-// fMemento.putInteger(P_ORDER_TYPE, DATE); >+ if (fMemento.getString(P_USE_LIMIT) == null) >+ fMemento.putString(P_USE_LIMIT, "true"); //$NON-NLS-1$ >+ if (fMemento.getInteger(P_LOG_LIMIT) == null) >+ fMemento.putInteger(P_LOG_LIMIT, 50); >+ if (fMemento.getString(P_LOG_INFO) == null) >+ fMemento.putString(P_LOG_INFO, "true"); //$NON-NLS-1$ >+ if (fMemento.getString(P_LOG_WARNING) == null) >+ fMemento.putString(P_LOG_WARNING, "true"); //$NON-NLS-1$ >+ if (fMemento.getString(P_LOG_ERROR) == null) >+ fMemento.putString(P_LOG_ERROR, "true"); //$NON-NLS-1$ >+ if (fMemento.getString(P_SHOW_ALL_SESSIONS) == null) >+ fMemento.putString(P_SHOW_ALL_SESSIONS, "true"); //$NON-NLS-1$ >+ Integer width = fMemento.getInteger(P_COLUMN_1); >+ if (width == null || width.intValue() == 0) >+ fMemento.putInteger(P_COLUMN_1, 300); >+ width = fMemento.getInteger(P_COLUMN_2); >+ if (width == null || width.intValue() == 0) >+ fMemento.putInteger(P_COLUMN_2, 150); >+ width = fMemento.getInteger(P_COLUMN_3); >+ if (width == null || width.intValue() == 0) >+ fMemento.putInteger(P_COLUMN_3, 150); >+ if (fMemento.getString(P_ACTIVATE) == null) >+ fMemento.putString(P_ACTIVATE, "true"); //$NON-NLS-1$ >+ >+ fMemento.putInteger(P_ORDER_VALUE, DESCENDING); >+ fMemento.putInteger(P_ORDER_TYPE, DATE); > } > > public void saveState(IMemento memento) { >-// if (this.fMemento == null || memento == null) >-// return; >-// this.fMemento.putInteger(P_COLUMN_1, fColumn1.getWidth()); >-// this.fMemento.putInteger(P_COLUMN_2, fColumn2.getWidth()); >-// this.fMemento.putInteger(P_COLUMN_3, fColumn3.getWidth()); >-// this.fMemento.putString(P_ACTIVATE, >-// fActivateViewAction.isChecked() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >-// memento.putMemento(this.fMemento); >-// writeSettings(); >+ if (this.fMemento == null || memento == null) >+ return; >+ this.fMemento.putInteger(P_COLUMN_1, fColumn1.getWidth()); >+ this.fMemento.putInteger(P_COLUMN_2, fColumn2.getWidth()); >+ this.fMemento.putInteger(P_COLUMN_3, fColumn3.getWidth()); >+ this.fMemento.putString(P_ACTIVATE, >+ fActivateViewAction.isChecked() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >+ memento.putMemento(this.fMemento); >+ writeSettings(); > } > > private void addMouseListeners() { >@@ -1019,26 +1029,26 @@ > return; > } > try { >-// fMemento.putString(P_USE_LIMIT, s.getBoolean(P_USE_LIMIT) ? "true":"false"); //$NON-NLS-1$ //$NON-NLS-2$ >-// fMemento.putString(P_LOG_INFO, s.getBoolean(P_LOG_INFO) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >-// fMemento.putString(P_LOG_WARNING, s.getBoolean(P_LOG_WARNING) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >-// fMemento.putString(P_LOG_ERROR, s.getBoolean(P_LOG_ERROR) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >-// fMemento.putString(P_SHOW_ALL_SESSIONS, s.getBoolean(P_SHOW_ALL_SESSIONS) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >-// fMemento.putInteger(P_LOG_LIMIT, s.getInt(P_LOG_LIMIT)); >-// fMemento.putInteger(P_COLUMN_1, p.getInt(P_COLUMN_1) > 0 ? p.getInt(P_COLUMN_1) : 300); >-// fMemento.putInteger(P_COLUMN_2, p.getInt(P_COLUMN_2) > 0 ? p.getInt(P_COLUMN_2) : 150); >-// fMemento.putInteger(P_COLUMN_3, p.getInt(P_COLUMN_3) > 0 ? p.getInt(P_COLUMN_3) : 150); >-// fMemento.putString(P_ACTIVATE, p.getBoolean(P_ACTIVATE) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >-// int order = p.getInt(P_ORDER_VALUE); >-// fMemento.putInteger(P_ORDER_VALUE, order == 0 ? DESCENDING : order); >-// fMemento.putInteger(P_ORDER_TYPE, p.getInt(P_ORDER_TYPE)); >+ fMemento.putString(P_USE_LIMIT, s.getBoolean(P_USE_LIMIT) ? "true":"false"); //$NON-NLS-1$ //$NON-NLS-2$ >+ fMemento.putString(P_LOG_INFO, s.getBoolean(P_LOG_INFO) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >+ fMemento.putString(P_LOG_WARNING, s.getBoolean(P_LOG_WARNING) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >+ fMemento.putString(P_LOG_ERROR, s.getBoolean(P_LOG_ERROR) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >+ fMemento.putString(P_SHOW_ALL_SESSIONS, s.getBoolean(P_SHOW_ALL_SESSIONS) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >+ fMemento.putInteger(P_LOG_LIMIT, s.getInt(P_LOG_LIMIT)); >+ fMemento.putInteger(P_COLUMN_1, p.getInt(P_COLUMN_1) > 0 ? p.getInt(P_COLUMN_1) : 300); >+ fMemento.putInteger(P_COLUMN_2, p.getInt(P_COLUMN_2) > 0 ? p.getInt(P_COLUMN_2) : 150); >+ fMemento.putInteger(P_COLUMN_3, p.getInt(P_COLUMN_3) > 0 ? p.getInt(P_COLUMN_3) : 150); >+ fMemento.putString(P_ACTIVATE, p.getBoolean(P_ACTIVATE) ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ >+ int order = p.getInt(P_ORDER_VALUE); >+ fMemento.putInteger(P_ORDER_VALUE, order == 0 ? DESCENDING : order); >+ fMemento.putInteger(P_ORDER_TYPE, p.getInt(P_ORDER_TYPE)); > } catch (NumberFormatException e) { >-// fMemento.putInteger(P_LOG_LIMIT, 50); >-// fMemento.putInteger(P_COLUMN_1, 300); >-// fMemento.putInteger(P_COLUMN_2, 150); >-// fMemento.putInteger(P_COLUMN_3, 150); >-// fMemento.putInteger(P_ORDER_TYPE, DATE); >-// fMemento.putInteger(P_ORDER_VALUE, DESCENDING); >+ fMemento.putInteger(P_LOG_LIMIT, 50); >+ fMemento.putInteger(P_COLUMN_1, 300); >+ fMemento.putInteger(P_COLUMN_2, 150); >+ fMemento.putInteger(P_COLUMN_3, 150); >+ fMemento.putInteger(P_ORDER_TYPE, DATE); >+ fMemento.putInteger(P_ORDER_VALUE, DESCENDING); > } > } > >@@ -1051,23 +1061,23 @@ > IDialogSettings settings = getLogSettings(); > if (settings == null) > settings = PDERuntimePlugin.getDefault().getDialogSettings().addNewSection(getClass().getName()); >-// settings.put(P_USE_LIMIT, fMemento.getString(P_USE_LIMIT).equals("true")); //$NON-NLS-1$ >-// settings.put(P_LOG_LIMIT, fMemento.getInteger(P_LOG_LIMIT).intValue()); >-// settings.put(P_LOG_INFO, fMemento.getString(P_LOG_INFO).equals("true")); //$NON-NLS-1$ >-// settings.put(P_LOG_WARNING, fMemento.getString(P_LOG_WARNING).equals("true")); //$NON-NLS-1$ >-// settings.put(P_LOG_ERROR, fMemento.getString(P_LOG_ERROR).equals("true")); //$NON-NLS-1$ >-// settings.put(P_SHOW_ALL_SESSIONS, fMemento.getString(P_SHOW_ALL_SESSIONS).equals("true")); //$NON-NLS-1$ >+ settings.put(P_USE_LIMIT, fMemento.getString(P_USE_LIMIT).equals("true")); //$NON-NLS-1$ >+ settings.put(P_LOG_LIMIT, fMemento.getInteger(P_LOG_LIMIT).intValue()); >+ settings.put(P_LOG_INFO, fMemento.getString(P_LOG_INFO).equals("true")); //$NON-NLS-1$ >+ settings.put(P_LOG_WARNING, fMemento.getString(P_LOG_WARNING).equals("true")); //$NON-NLS-1$ >+ settings.put(P_LOG_ERROR, fMemento.getString(P_LOG_ERROR).equals("true")); //$NON-NLS-1$ >+ settings.put(P_SHOW_ALL_SESSIONS, fMemento.getString(P_SHOW_ALL_SESSIONS).equals("true")); //$NON-NLS-1$ > } > > private void writeViewSettings(){ > Preferences preferences = getLogPreferences(); >-// preferences.setValue(P_COLUMN_1, fMemento.getInteger(P_COLUMN_1).intValue()); >-// preferences.setValue(P_COLUMN_2, fMemento.getInteger(P_COLUMN_2).intValue()); >-// preferences.setValue(P_COLUMN_3, fMemento.getInteger(P_COLUMN_3).intValue()); >-// preferences.setValue(P_ACTIVATE, fMemento.getString(P_ACTIVATE).equals("true")); //$NON-NLS-1$ >-// int order = fMemento.getInteger(P_ORDER_VALUE).intValue(); >-// preferences.setValue(P_ORDER_VALUE, order == 0 ? DESCENDING : order); >-// preferences.setValue(P_ORDER_TYPE, fMemento.getInteger(P_ORDER_TYPE).intValue()); >+ preferences.setValue(P_COLUMN_1, fMemento.getInteger(P_COLUMN_1).intValue()); >+ preferences.setValue(P_COLUMN_2, fMemento.getInteger(P_COLUMN_2).intValue()); >+ preferences.setValue(P_COLUMN_3, fMemento.getInteger(P_COLUMN_3).intValue()); >+ preferences.setValue(P_ACTIVATE, fMemento.getString(P_ACTIVATE).equals("true")); //$NON-NLS-1$ >+ int order = fMemento.getInteger(P_ORDER_VALUE).intValue(); >+ preferences.setValue(P_ORDER_VALUE, order == 0 ? DESCENDING : order); >+ preferences.setValue(P_ORDER_TYPE, fMemento.getInteger(P_ORDER_TYPE).intValue()); > } > > public void sortByDateDescending() { >@@ -1075,10 +1085,11 @@ > } > > protected Job getOpenLogFileJob() { >+ final Display display=Display.getDefault(); > final Shell shell = getViewSite().getShell(); > return new Job(PDERuntimeMessages.get().OpenLogDialog_message) { > protected IStatus run(IProgressMonitor monitor) { >- boolean failed = false; >+ boolean failed = true; > if (fInputFile.length() <= LogReader.MAX_FILE_LENGTH) { > // failed = !Program.launch(fInputFile.getAbsolutePath()); > // if (failed) { >@@ -1091,7 +1102,7 @@ > } > if (failed) { > final OpenLogDialog openDialog = new OpenLogDialog(shell, fInputFile); >- Display.getDefault().asyncExec(new Runnable() { >+ display.asyncExec(new Runnable() { > public void run() { > openDialog.create(); > openDialog.open();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 347957
:
197097
|
197362
|
197365