diff options
author | 2019-02-12 15:13:11 +0000 | |
---|---|---|
committer | 2019-02-12 16:07:05 +0000 | |
commit | 07e304f9d47b5c6a653719165b91351b4a7c6e90 (patch) | |
tree | f0e01ead9bce7270a865ecff868e8e673a3e9b84 | |
parent | 9240775c0bafe3f5bf8d8cb3450dfcffbcfcc0b2 (diff) | |
download | org.eclipse.rap.incubator.pde-07e304f9d47b5c6a653719165b91351b4a7c6e90.tar.gz org.eclipse.rap.incubator.pde-07e304f9d47b5c6a653719165b91351b4a7c6e90.tar.xz org.eclipse.rap.incubator.pde-07e304f9d47b5c6a653719165b91351b4a7c6e90.zip |
There is no clipboard support in RAP (see bug 360790) so copy clipboard
button is disabled. Take benefits of this to synchronize code with
latest RCP version
Change-Id: Ibf94d95d8064e31afbaf0cc7f73bffa96345ea03
Signed-off-by: <a_mergey@yahoo.fr>
28 files changed, 487 insertions, 424 deletions
diff --git a/bundles/org.eclipse.rap.ui.views.log/.classpath b/bundles/org.eclipse.rap.ui.views.log/.classpath index 121e527..22f3064 100644 --- a/bundles/org.eclipse.rap.ui.views.log/.classpath +++ b/bundles/org.eclipse.rap.ui.views.log/.classpath @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="output" path="bin"/> </classpath> diff --git a/bundles/org.eclipse.rap.ui.views.log/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.rap.ui.views.log/.settings/org.eclipse.jdt.core.prefs index 825af21..8cc6b4e 100644 --- a/bundles/org.eclipse.rap.ui.views.log/.settings/org.eclipse.jdt.core.prefs +++ b/bundles/org.eclipse.rap.ui.views.log/.settings/org.eclipse.jdt.core.prefs @@ -26,6 +26,7 @@ org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nul org.eclipse.jdt.core.compiler.annotation.nullable.secondary= org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.compliance=1.8 @@ -34,6 +35,7 @@ org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.doc.comment.support=enabled org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000 +org.eclipse.jdt.core.compiler.problem.APILeak=warning org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore @@ -45,7 +47,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod= org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=warning org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore +org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled org.eclipse.jdt.core.compiler.problem.fieldHiding=warning @@ -62,7 +64,7 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore @@ -71,7 +73,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore @@ -93,7 +95,7 @@ org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore +org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore @@ -103,16 +105,21 @@ org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning +org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled +org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled diff --git a/bundles/org.eclipse.rap.ui.views.log/META-INF/MANIFEST.MF b/bundles/org.eclipse.rap.ui.views.log/META-INF/MANIFEST.MF index 9dc8e51..f889b14 100644 --- a/bundles/org.eclipse.rap.ui.views.log/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.rap.ui.views.log/META-INF/MANIFEST.MF @@ -16,3 +16,4 @@ Bundle-ActivationPolicy: lazy Import-Package: com.ibm.icu.text, javax.servlet;version="2.3.0", javax.servlet.http;version="2.3.0" +Automatic-Module-Name: org.eclipse.rap.ui.views.log diff --git a/bundles/org.eclipse.rap.ui.views.log/about.html b/bundles/org.eclipse.rap.ui.views.log/about.html index 4602330..73531c2 100644 --- a/bundles/org.eclipse.rap.ui.views.log/about.html +++ b/bundles/org.eclipse.rap.ui.views.log/about.html @@ -2,27 +2,36 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> -<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>About</title> </head> <body lang="EN-US"> -<h2>About This Content</h2> - -<p>June 2, 2006</p> -<h3>License</h3> + <h2>About This Content</h2> -<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. -For purposes of the EPL, "Program" will mean the Content.</p> + <p>November 30, 2017</p> + <h3>License</h3> -<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p> + <p> + The Eclipse Foundation makes available all content in this plug-in + ("Content"). Unless otherwise indicated below, the Content + is provided to you under the terms and conditions of the Eclipse + Public License Version 2.0 ("EPL"). A copy of the EPL is + available at <a href="http://www.eclipse.org/legal/epl-2.0">http://www.eclipse.org/legal/epl-2.0</a>. + For purposes of the EPL, "Program" will mean the Content. + </p> + + + <p> + If you did not receive this Content directly from the Eclipse + Foundation, the Content is being redistributed by another party + ("Redistributor") and different terms and conditions may + apply to your use of any object code in the Content. Check the + Redistributor's license that was provided with the Content. If no such + license exists, contact the Redistributor. Unless otherwise indicated + below, the terms and conditions of the EPL still apply to any source + code in the Content and such source code may be obtained at <a + href="http://www.eclipse.org/">http://www.eclipse.org</a>. + </p> </body> </html>
\ No newline at end of file diff --git a/bundles/org.eclipse.rap.ui.views.log/build.properties b/bundles/org.eclipse.rap.ui.views.log/build.properties index a204574..188b6ee 100644 --- a/bundles/org.eclipse.rap.ui.views.log/build.properties +++ b/bundles/org.eclipse.rap.ui.views.log/build.properties @@ -1,9 +1,12 @@ ############################################################################### # Copyright (c) 2005, 2007 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 +# +# This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 # which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 # # Contributors: # IBM Corporation - initial API and implementation diff --git a/bundles/org.eclipse.rap.ui.views.log/plugin.properties b/bundles/org.eclipse.rap.ui.views.log/plugin.properties index cdd1396..d6be850 100644 --- a/bundles/org.eclipse.rap.ui.views.log/plugin.properties +++ b/bundles/org.eclipse.rap.ui.views.log/plugin.properties @@ -1,9 +1,12 @@ ############################################################################### # Copyright (c) 2000, 2008 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 +# +# This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 # which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 # # Contributors: # IBM Corporation - initial API and implementation diff --git a/bundles/org.eclipse.rap.ui.views.log/plugin.xml b/bundles/org.eclipse.rap.ui.views.log/plugin.xml index 7529164..e5be867 100644 --- a/bundles/org.eclipse.rap.ui.views.log/plugin.xml +++ b/bundles/org.eclipse.rap.ui.views.log/plugin.xml @@ -1,10 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.2"?><!-- Copyright (c) 2005, 2008 IBM Corporation and others. - All rights reserved. This program and the accompanying materials - are made available under the terms of the Eclipse Public License v1.0 + + This program and the accompanying materials + are made available under the terms of the Eclipse Public License 2.0 which accompanies this distribution, and is available at - http://www.eclipse.org/legal/epl-v10.html + https://www.eclipse.org/legal/epl-2.0/ + + SPDX-License-Identifier: EPL-2.0 Contributors: IBM Corporation - initial API and implementation @@ -35,6 +38,18 @@ id="org.eclipse.pde.runtime.LogView"> </viewShortcut> </perspectiveExtension> + <perspectiveExtension + targetID="org.eclipse.debug.ui.DebugPerspective"> + <view + relative="org.eclipse.ui.console.ConsoleView" + visible="false" + id="org.eclipse.pde.runtime.LogView" + relationship="stack"> + </view> + <viewShortcut + id="org.eclipse.pde.runtime.LogView"> + </viewShortcut> + </perspectiveExtension> </extension> <extension point="org.eclipse.ui.bindings"> diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/AbstractEntry.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/AbstractEntry.java index 02f53c4..c121c95 100644 --- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/AbstractEntry.java +++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/AbstractEntry.java @@ -1,9 +1,12 @@ /******************************************************************************* - * Copyright (c) 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * Copyright (c) 2007, 2018 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -26,7 +29,7 @@ public abstract class AbstractEntry extends PlatformObject implements IWorkbench /** * The collection of direct children of this entry */ - private List children = new ArrayList(); + private List<AbstractEntry> children = new ArrayList<>(); protected Object parent; /** @@ -42,9 +45,6 @@ public abstract class AbstractEntry extends PlatformObject implements IWorkbench } } - /** - * @see IWorkbenchAdapter#getChildren(Object) - */ @Override public Object[] getChildren(Object parent) { return children.toArray(); @@ -66,25 +66,16 @@ public abstract class AbstractEntry extends PlatformObject implements IWorkbench return children.size(); } - /** - * @see IWorkbenchAdapter#getImageDescriptor(Object) - */ @Override public ImageDescriptor getImageDescriptor(Object object) { return null; } - /** - * @see IWorkbenchAdapter#getLabel(Object) - */ @Override public String getLabel(Object o) { return null; } - /** - * @see IWorkbenchAdapter#getParent(Object) - */ @Override public Object getParent(Object o) { return parent; @@ -103,7 +94,7 @@ public abstract class AbstractEntry extends PlatformObject implements IWorkbench * * @param list the list of children to remove */ - public void removeChildren(List list) { + public void removeChildren(List<AbstractEntry> list) { children.removeAll(list); } diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/Activator.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/Activator.java index 2c3ca93..171331b 100644 --- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/Activator.java +++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/Activator.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2007, 2016 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/EventDetailsDialog.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/EventDetailsDialog.java index 6d08b3b..a6b4663 100644 --- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/EventDetailsDialog.java +++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/EventDetailsDialog.java @@ -1,9 +1,12 @@ /******************************************************************************* - * Copyright (c) 2000, 2016 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * Copyright (c) 2000, 2018 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -37,10 +40,10 @@ import org.eclipse.swt.widgets.*; import org.eclipse.ui.*; /** - * Displays details about Log Entry. - * Event information is split in three sections: details, stack trace and session. Details - * contain event date, message and severity. Stack trace is displayed if an exception is bound - * to event. Stack trace entries can be filtered. + * Displays details about Log Entry. Event information is split in three + * sections: details, stack trace and session. Details contain event date, + * message and severity. Stack trace is displayed if an exception is bound to + * event. Stack trace entries can be filtered. */ public class EventDetailsDialog extends TrayDialog { @@ -93,12 +96,17 @@ public class EventDetailsDialog extends TrayDialog { /** * - * @param parentShell shell in which dialog is displayed - * @param selection entry initially selected and to be displayed - * @param provider viewer - * @param comparator comparator used to order all entries + * @param parentShell + * shell in which dialog is displayed + * @param selection + * entry initially selected and to be displayed + * @param provider + * viewer + * @param comparator + * comparator used to order all entries */ - protected EventDetailsDialog(Shell parentShell, LogView logView, IAdaptable selection, ISelectionProvider provider, Comparator comparator, IMemento memento) { + protected EventDetailsDialog(Shell parentShell, LogView logView, IAdaptable selection, ISelectionProvider provider, + Comparator comparator, IMemento memento) { super(parentShell); this.logView = logView; this.provider = (TreeViewer) provider; @@ -117,9 +125,6 @@ public class EventDetailsDialog extends TrayDialog { stackFilterPatterns = getFilters(); } - /* - * @see org.eclipse.jface.window.Window#configureShell(Shell) - */ @Override protected void configureShell(Shell newShell) { super.configureShell(newShell); @@ -180,7 +185,7 @@ public class EventDetailsDialog extends TrayDialog { c = 100; // Text area gets 100 b = height - a - c; // Stack trace should take up majority of room } - sashWeights = new int[] {a, b, c}; + sashWeights = new int[] { a, b, c }; } getSashForm().setWeights(sashWeights); return super.open(); @@ -261,28 +266,26 @@ public class EventDetailsDialog extends TrayDialog { findNextSelectedChild(entry); } else { // at end of list but can branch into child elements - bug 58083 setEntryChildren(entry); - entry = entryChildren[0]; isAtEndOfLog = entryChildren.length == 0; isLastChild = entryChildren.length == 0; + if (entryChildren.length > 0) { + entry = entryChildren[0]; + } } setEntrySelectionInTable(); } protected void copyPressed() { - StringWriter writer = new StringWriter(); - PrintWriter pwriter = new PrintWriter(writer); - - entry.write(pwriter); - pwriter.flush(); - String textVersion = writer.toString(); - try { - pwriter.close(); - writer.close(); - } catch (IOException e) { // do nothing + try (StringWriter writer = new StringWriter(); PrintWriter pwriter = new PrintWriter(writer)) { + entry.write(pwriter); + pwriter.flush(); + String textVersion = writer.toString(); + // set the clipboard contents + // clipboard.setContents(new Object[] { textVersion }, new + // Transfer[] { TextTransfer.getInstance() }); + } catch (IOException e) { + // do nothing } - // set the clipboard contents - // clipboard.setContents(new Object[] {textVersion}, new Transfer[] - // {TextTransfer.getInstance()}); } public void setComparator(Comparator comparator) { @@ -292,33 +295,24 @@ public class EventDetailsDialog extends TrayDialog { private void setComparator(byte sortType, final int sortOrder) { if (sortType == LogView.DATE) { - comparator = new Comparator() { - @Override - public int compare(Object e1, Object e2) { - Date date1 = ((LogEntry) e1).getDate(); - Date date2 = ((LogEntry) e2).getDate(); - if (sortOrder == LogView.ASCENDING) - return date1.getTime() < date2.getTime() ? LogView.DESCENDING : LogView.ASCENDING; - return date1.getTime() > date2.getTime() ? LogView.DESCENDING : LogView.ASCENDING; - } + comparator = (e1, e2) -> { + Date date1 = ((LogEntry) e1).getDate(); + Date date2 = ((LogEntry) e2).getDate(); + if (sortOrder == LogView.ASCENDING) + return date1.getTime() < date2.getTime() ? LogView.DESCENDING : LogView.ASCENDING; + return date1.getTime() > date2.getTime() ? LogView.DESCENDING : LogView.ASCENDING; }; } else if (sortType == LogView.PLUGIN) { - comparator = new Comparator() { - @Override - public int compare(Object e1, Object e2) { - LogEntry entry1 = (LogEntry) e1; - LogEntry entry2 = (LogEntry) e2; - return collator.compare(entry1.getPluginId(), entry2.getPluginId()) * sortOrder; - } + comparator = (e1, e2) -> { + LogEntry entry1 = (LogEntry) e1; + LogEntry entry2 = (LogEntry) e2; + return collator.compare(entry1.getPluginId(), entry2.getPluginId()) * sortOrder; }; } else { - comparator = new Comparator() { - @Override - public int compare(Object e1, Object e2) { - LogEntry entry1 = (LogEntry) e1; - LogEntry entry2 = (LogEntry) e2; - return collator.compare(entry1.getMessage(), entry2.getMessage()) * sortOrder; - } + comparator = (e1, e2) -> { + LogEntry entry1 = (LogEntry) e1; + LogEntry entry2 = (LogEntry) e2; + return collator.compare(entry1.getMessage(), entry2.getMessage()) * sortOrder; }; } } @@ -401,7 +395,8 @@ public class EventDetailsDialog extends TrayDialog { if (isChild(entry)) { boolean canGoToParent = (entry.getParent(entry) instanceof LogEntry); backButton.setEnabled((childIndex > 0) || canGoToParent); - nextButton.setEnabled(nextChildExists(entry, parentEntry, entryChildren) || entry.hasChildren() || !isLastChild || !isAtEnd); + nextButton.setEnabled(nextChildExists(entry, parentEntry, entryChildren) || entry.hasChildren() + || !isLastChild || !isAtEnd); } else { backButton.setEnabled(childIndex != 0); nextButton.setEnabled(!isAtEnd || entry.hasChildren()); @@ -411,7 +406,7 @@ public class EventDetailsDialog extends TrayDialog { private void findNextSelectedChild(AbstractEntry originalEntry) { if (isChild(parentEntry)) { // we're at the end of the child list; find next parent - // to select. If the parent is a child at the end of the child + // to select. If the parent is a child at the end of the child // list, find its next parent entry to select, etc. entry = parentEntry; @@ -447,10 +442,11 @@ public class EventDetailsDialog extends TrayDialog { } } - private boolean nextChildExists(AbstractEntry originalEntry, AbstractEntry originalParent, AbstractEntry[] originalEntries) { + private boolean nextChildExists(AbstractEntry originalEntry, AbstractEntry originalParent, + AbstractEntry[] originalEntries) { if (isChild(parentEntry)) { // we're at the end of the child list; find next parent - // to select. If the parent is a child at the end of the child + // to select. If the parent is a child at the end of the child // list, find its next parent entry to select, etc. entry = parentEntry; @@ -508,14 +504,14 @@ public class EventDetailsDialog extends TrayDialog { if (comparator != null) Arrays.sort(children, comparator); - List result = new ArrayList(); + List<AbstractEntry> result = new ArrayList<>(); for (Object element : children) { if (element instanceof AbstractEntry) { - result.add(element); + result.add((AbstractEntry) element); } } - entryChildren = (AbstractEntry[]) result.toArray(new AbstractEntry[result.size()]); + entryChildren = result.toArray(new AbstractEntry[result.size()]); } public SashForm getSashForm() { @@ -554,7 +550,7 @@ public class EventDetailsDialog extends TrayDialog { Composite comp = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); layout.marginWidth = layout.marginHeight = 0; - //layout.numColumns = 1; + // layout.numColumns = 1; comp.setLayout(layout); comp.setLayoutData(new GridData(GridData.FILL_VERTICAL)); ((GridData) comp.getLayoutData()).verticalAlignment = SWT.BOTTOM; @@ -589,6 +585,8 @@ public class EventDetailsDialog extends TrayDialog { e.result = Messages.get().EventDetailsDialog_copy; } }); + copyButton.setEnabled(false); + // There is no clipboard access in rap so button is disabled nextButton = createButton(container, IDialogConstants.NEXT_ID, "", false); //$NON-NLS-1$ gd = new GridData(); @@ -630,7 +628,8 @@ public class EventDetailsDialog extends TrayDialog { } }); - // set numColumns at the end, after all createButton() calls, which change this value + // set numColumns at the end, after all createButton() calls, which change this + // value layout.numColumns = 2; } @@ -687,9 +686,9 @@ public class EventDetailsDialog extends TrayDialog { label.setText(Messages.get().EventDetailsDialog_message); gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING); label.setLayoutData(gd); - msgText = new Text(textContainer, SWT.MULTI | SWT.V_SCROLL | SWT.WRAP | SWT.BORDER); + msgText = new Text(textContainer, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER); msgText.setEditable(false); - gd = new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_BEGINNING | GridData.GRAB_VERTICAL); + gd = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL); gd.horizontalSpan = 2; gd.grabExcessVerticalSpace = true; msgText.setLayoutData(gd); @@ -742,6 +741,7 @@ public class EventDetailsDialog extends TrayDialog { /** * Loads filters from preferences. + * * @return filters from preferences or empty array * * @since 3.4 @@ -757,18 +757,17 @@ public class EventDetailsDialog extends TrayDialog { } StringTokenizer st = new StringTokenizer(filtersString, ";"); //$NON-NLS-1$ - List filters = new ArrayList(); + List<String> filters = new ArrayList<>(); while (st.hasMoreElements()) { String filter = st.nextToken(); filters.add(filter); } - return (String[]) filters.toArray(new String[filters.size()]); + return filters.toArray(new String[filters.size()]); } /** - * Filters stack trace. - * Every stack trace line is compared against all patterns. + * Filters stack trace. Every stack trace line is compared against all patterns. * If line contains any of pattern strings, it's excluded from output. * * @returns filtered stack trace @@ -780,7 +779,7 @@ public class EventDetailsDialog extends TrayDialog { } StringTokenizer st = new StringTokenizer(stack, "\n"); //$NON-NLS-1$ - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); while (st.hasMoreTokens()) { String stackElement = st.nextToken(); @@ -799,10 +798,11 @@ public class EventDetailsDialog extends TrayDialog { return result.toString(); } - //--------------- configuration handling -------------- + // --------------- configuration handling -------------- /** * Stores the current state in the dialog settings. + * * @since 2.0 */ private void storeSettings() { @@ -810,8 +810,8 @@ public class EventDetailsDialog extends TrayDialog { } /** - * Returns the dialog settings object used to share state - * between several event detail dialogs. + * Returns the dialog settings object used to share state between several event + * detail dialogs. * * @return the dialog settings to be used */ @@ -824,8 +824,8 @@ public class EventDetailsDialog extends TrayDialog { } /** - * Initializes itself from the dialog settings with the same state - * as at the previous invocation. + * Initializes itself from the dialog settings with the same state as at the + * previous invocation. */ private void readConfiguration() { IDialogSettings s = getDialogSettings(); @@ -867,6 +867,7 @@ public class EventDetailsDialog extends TrayDialog { /** * Utility method to get all top level elements of the Log View + * * @return top level elements of the Log View */ private AbstractEntry[] getElements() { diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/EventDetailsDialogAction.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/EventDetailsDialogAction.java index 7ed0334..6036f86 100644 --- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/EventDetailsDialogAction.java +++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/EventDetailsDialogAction.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2016 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/FilterDialog.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/FilterDialog.java index 5c8e64c..24437cd 100644 --- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/FilterDialog.java +++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/FilterDialog.java @@ -1,9 +1,12 @@ /******************************************************************************* - * Copyright (c) 2003, 2017 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * Copyright (c) 2003, 2018 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -57,9 +60,6 @@ public class FilterDialog extends TrayDialog { this.memento = memento; } - /* - * @see org.eclipse.jface.window.Window#configureShell(Shell) - */ @Override protected void configureShell(Shell newShell) { super.configureShell(newShell); @@ -312,7 +312,7 @@ public class FilterDialog extends TrayDialog { // store Event Dialog stack trace filter preferences memento.putBoolean(EventDetailsDialog.FILTER_ENABLED, filterEnabled.getSelection()); - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); String[] items = filterList.getItems(); for (int i = 0; i < items.length; i++) { sb.append(items[i]); diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/Group.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/Group.java index cb3f124..a6f1de2 100644 --- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/Group.java +++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/Group.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2007, 2016 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/IHelpContextIds.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/IHelpContextIds.java index 6035aae..7936c18 100644 --- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/IHelpContextIds.java +++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/IHelpContextIds.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2007, 2013 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/ILogFileProvider.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/ILogFileProvider.java index dcc76a1..5ae1232 100644 --- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/ILogFileProvider.java +++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/ILogFileProvider.java @@ -1,9 +1,12 @@ /******************************************************************************* - * Copyright (c) 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * Copyright (c) 2008, 2018 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -23,5 +26,5 @@ public interface ILogFileProvider { * @return Map of java.io.File log files index by String names. * @since 3.4 */ - Map getLogSources(); + Map<String, String> getLogSources(); }
\ No newline at end of file diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/ImportLogAction.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/ImportLogAction.java index 9b33ea9..afd4c7c 100644 --- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/ImportLogAction.java +++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/ImportLogAction.java @@ -1,9 +1,12 @@ /******************************************************************************* - * Copyright (c) 2008, 2017 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * Copyright (c) 2008, 2018 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -153,10 +156,10 @@ public class ImportLogAction extends Action implements IMenuCreator { */ private ImportConfigurationLogAction[] getLogActions() { List<ImportConfigurationLogAction> result = new ArrayList<>(); - Map<?, ?> sources = LogFilesManager.getLogSources(); - for (Entry<?, ?> entry : sources.entrySet()) { - String name = (String) entry.getKey(); - String location = (String) entry.getValue(); + Map<String, String> sources = LogFilesManager.getLogSources(); + for (Entry<String, String> entry : sources.entrySet()) { + String name = entry.getKey(); + String location = entry.getValue(); result.add(new ImportConfigurationLogAction(name, location)); } return result.toArray(new ImportConfigurationLogAction[result.size()]); diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogEntry.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogEntry.java index 15a3c3c..c81da11 100644 --- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogEntry.java +++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogEntry.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2017 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogFilesManager.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogFilesManager.java index 6698393..31d8422 100644 --- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogFilesManager.java +++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogFilesManager.java @@ -1,9 +1,12 @@ /******************************************************************************* - * Copyright (c) 2008, 2016 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * Copyright (c) 2008, 2018 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -19,7 +22,7 @@ import java.util.*; */ public class LogFilesManager { - private static List logFileProviders = new ArrayList(); + private static List<ILogFileProvider> logFileProviders = new ArrayList<>(); /** * Adds log file provider. @@ -42,12 +45,12 @@ public class LogFilesManager { /** * Returns the list of logs. */ - static Map getLogSources() { - ILogFileProvider[] providers = (ILogFileProvider[]) logFileProviders.toArray(new ILogFileProvider[logFileProviders.size()]); - Map result = new HashMap(providers.length); + static Map<String, String> getLogSources() { + ILogFileProvider[] providers = logFileProviders.toArray(new ILogFileProvider[logFileProviders.size()]); + Map<String, String> result = new HashMap<>(providers.length); for (ILogFileProvider provider : providers) { - Map sources = provider.getLogSources(); + Map<String, String> sources = provider.getLogSources(); result.putAll(sources); } diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogReader.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogReader.java index 071f27e..82b74d5 100644 --- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogReader.java +++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogReader.java @@ -1,9 +1,12 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * Copyright (c) 2000, 2018 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -33,7 +36,8 @@ class LogReader { private static final int TEXT_STATE = 60; private static final int UNKNOWN_STATE = 70; - public static LogSession parseLogFile(File file, long maxLogTailSizeInMegaByte, List entries, IMemento memento) { + public static LogSession parseLogFile(File file, long maxLogTailSizeInMegaByte, List<LogEntry> entries, + IMemento memento) { if (!file.exists()) return null; @@ -41,7 +45,7 @@ class LogReader { && memento.getInteger(LogView.P_LOG_LIMIT).intValue() == 0) return null; - ArrayList parents = new ArrayList(); + ArrayList<LogEntry> parents = new ArrayList<>(); LogEntry current = null; LogSession session = null; int writerState = UNKNOWN_STATE; @@ -125,7 +129,7 @@ class LogReader { int depth = entry.processSubEntry(line); setNewParent(parents, entry, depth); current = entry; - LogEntry parent = (LogEntry) parents.get(depth - 1); + LogEntry parent = parents.get(depth - 1); parent.addChild(entry); } catch (ParseException pe) { //do nothing, just toss the bad entry @@ -149,7 +153,7 @@ class LogReader { } } catch (IOException e) { // do nothing } finally { - if (file.length() > maxLogTailSizeInMegaByte && entries.size() == 0) { + if (file.length() > maxLogTailSizeInMegaByte && entries.isEmpty()) { LogEntry entry = new LogEntry(new Status(IStatus.WARNING, Activator.PLUGIN_ID, NLS.bind( Messages.get().LogReader_warn_noEntryWithinMaxLogTailSize, Long.valueOf(maxLogTailSizeInMegaByte)))); @@ -165,7 +169,7 @@ class LogReader { return currentSession; } - public static LogSession parseLogFile(File file, List entries, IMemento memento) { + public static LogSession parseLogFile(File file, List<LogEntry> entries, IMemento memento) { return parseLogFile(file, ONE_MEGA_BYTE_IN_BYTES, entries, memento); } @@ -209,7 +213,7 @@ class LogReader { /** * Adds entry to the list if it's not filtered. Removes entries exceeding the count limit. */ - private static void addEntry(LogEntry entry, List entries, IMemento memento) { + private static void addEntry(LogEntry entry, List<LogEntry> entries, IMemento memento) { if (isLogged(entry, memento)) { entries.add(entry); @@ -243,7 +247,7 @@ class LogReader { return false; } - private static void setNewParent(ArrayList parents, LogEntry entry, int depth) { + private static void setNewParent(ArrayList<LogEntry> parents, LogEntry entry, int depth) { if (depth + 1 > parents.size()) parents.add(entry); else diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogSession.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogSession.java index cf1febc..9aa99f2 100644 --- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogSession.java +++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogSession.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogView.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogView.java index 571bee8..7efab7b 100644 --- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogView.java +++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogView.java @@ -1,9 +1,12 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * Copyright (c) 2000, 2018 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -555,7 +558,7 @@ public class LogView extends ViewPart implements ILogListener { fFilteredTree.getViewer().setLabelProvider(fLabelProvider = new LogViewLabelProvider(this)); fLabelProvider.connect(this); fFilteredTree.getViewer().addSelectionChangedListener(e -> { - handleSelectionChanged(e.getSelection()); + handleSelectionChanged(e.getStructuredSelection()); if (fPropertiesAction.isEnabled()) ((EventDetailsDialogAction) fPropertiesAction).resetSelection(); }); @@ -780,6 +783,7 @@ public class LogView extends ViewPart implements ILogListener { reloadLog(); } + private void doDeleteLog() { String title = Messages.get().LogView_confirmDelete_title; String message = Messages.get().LogView_confirmDelete_message; @@ -800,14 +804,16 @@ public class LogView extends ViewPart implements ILogListener { public void fillContextMenu(IMenuManager manager) { // nothing } - public AbstractEntry[] getElements() { + public synchronized AbstractEntry[] getElements() { return elements.toArray(new AbstractEntry[elements.size()]); } protected void handleClear() { BusyIndicator.showWhile(fTree.getDisplay(), () -> { - elements.clear(); - groups.clear(); + synchronized (this) { + elements.clear(); + groups.clear(); + } if (currentSession != null) { currentSession.removeAllChildren(); } @@ -847,18 +853,17 @@ public class LogView extends ViewPart implements ILogListener { elements.clear(); groups.clear(); - List result = new ArrayList(); - LogSession lastLogSession = LogReader.parseLogFile(fInputFile, getLogMaxTailSize(), result, - fMemento); - if (lastLogSession != null - && (lastLogSession.getDate() == null || isEclipseStartTime(lastLogSession.getDate()))) { - currentSession = lastLogSession; - } else { - currentSession = null; - } + List<LogEntry> result = new ArrayList<>(); + LogSession lastLogSession = LogReader.parseLogFile(fInputFile, getLogMaxTailSize(), result, + fMemento); + if (lastLogSession != null && (lastLogSession.getDate() == null || isEclipseStartTime(lastLogSession.getDate()))) { + currentSession = lastLogSession; + } else { + currentSession = null; + } - group(result); - limitEntriesCount(); + group(result); + limitEntriesCount(); setContentDescription(getTitleSummary()); } @@ -888,10 +893,10 @@ public class LogView extends ViewPart implements ILogListener { return Messages.get().LogView_WorkspaceLogFile; } - Map<?, ?> sources = LogFilesManager.getLogSources(); + Map<String, String> sources = LogFilesManager.getLogSources(); if (sources.containsValue(path)) { - for (Entry<?, ?> entry : sources.entrySet()) { - String key = (String) entry.getKey(); + for (Entry<String, String> entry : sources.entrySet()) { + String key = entry.getKey(); if (entry.getValue().equals(path)) { return NLS.bind(Messages.get().LogView_LogFileTitle, new String[] { key, path }); } @@ -921,7 +926,7 @@ public class LogView extends ViewPart implements ILogListener { * Limits the number of entries according to the max entries limit set in * memento. */ - private void limitEntriesCount() { + private synchronized void limitEntriesCount() { int limit = Integer.MAX_VALUE; if (fMemento.getString(LogView.P_USE_LIMIT).equals("true")) {//$NON-NLS-1$ limit = fMemento.getInteger(LogView.P_LOG_LIMIT).intValue(); @@ -1098,24 +1103,22 @@ public class LogView extends ViewPart implements ILogListener { return; final ViewPart view = this; if (fDisplay != null) { - fDisplay.asyncExec(new Runnable() { - @Override - public void run() { - if (!fTree.isDisposed()) { - TreeViewer viewer = fFilteredTree.getViewer(); - viewer.refresh(); - viewer.expandToLevel(2); - fDeleteLogAction.setEnabled(fInputFile.exists() && fInputFile.equals(Platform.getLogFileLocation().toFile())); - fOpenLogAction.setEnabled(fInputFile.exists()); - fExportLogAction.setEnabled(fInputFile.exists()); - fExportLogEntryAction.setEnabled(!viewer.getSelection().isEmpty()); - if (activate && fActivateViewAction.isChecked()) { - IWorkbenchWindow window = Activator.getDefault().getWorkbench().getActiveWorkbenchWindow(); - if (window != null) { - IWorkbenchPage page = window.getActivePage(); - if (page != null) { - page.bringToTop(view); - } + fDisplay.asyncExec(() -> { + if (!fTree.isDisposed()) { + TreeViewer viewer = fFilteredTree.getViewer(); + viewer.refresh(); + viewer.expandToLevel(2); + fDeleteLogAction.setEnabled( + fInputFile.exists() && fInputFile.equals(Platform.getLogFileLocation().toFile())); + fOpenLogAction.setEnabled(fInputFile.exists()); + fExportLogAction.setEnabled(fInputFile.exists()); + fExportLogEntryAction.setEnabled(!viewer.getSelection().isEmpty()); + if (activate && fActivateViewAction.isChecked()) { + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + if (window != null) { + IWorkbenchPage page = window.getActivePage(); + if (page != null) { + page.bringToTop(view); } } } @@ -1138,7 +1141,7 @@ public class LogView extends ViewPart implements ILogListener { } } - private void handleSelectionChanged(ISelection selection) { + private void handleSelectionChanged(IStructuredSelection selection) { updateStatus(selection); updateSelectionStack(selection); // fCopyAction.setEnabled((!selection.isEmpty()) && ((IStructuredSelection) selection).getFirstElement() != null); @@ -1146,26 +1149,23 @@ public class LogView extends ViewPart implements ILogListener { fExportLogEntryAction.setEnabled(!selection.isEmpty()); } - private void updateSelectionStack(ISelection selection) { + private void updateSelectionStack(IStructuredSelection selection) { fSelectedStack = null; - if (selection instanceof IStructuredSelection) { - Object firstObject = ((IStructuredSelection) selection).getFirstElement(); - if (firstObject instanceof LogEntry) { - String stack = ((LogEntry) firstObject).getStack(); - if (stack != null && stack.length() > 0) { - fSelectedStack = stack; - } + Object firstObject = selection.getFirstElement(); + if (firstObject instanceof LogEntry) { + String stack = ((LogEntry) firstObject).getStack(); + if (stack != null && stack.length() > 0) { + fSelectedStack = stack; } } - } - private void updateStatus(ISelection selection) { + private void updateStatus(IStructuredSelection selection) { IStatusLineManager status = getViewSite().getActionBars().getStatusLineManager(); if (selection.isEmpty()) status.setMessage(null); else { - Object element = ((IStructuredSelection) selection).getFirstElement(); + Object element = selection.getFirstElement(); status.setMessage(((LogViewLabelProvider) fFilteredTree.getViewer().getLabelProvider()).getColumnText(element, 0)); } } @@ -1174,12 +1174,12 @@ public class LogView extends ViewPart implements ILogListener { * Converts selected log view element to string. * @return textual log entry representation or null if selection doesn't contain log entry */ - private static String selectionToString(ISelection selection) { + private static String selectionToString(IStructuredSelection selection) { String textVersion = null; try (StringWriter writer = new StringWriter(); PrintWriter pwriter = new PrintWriter(writer)) { if (selection.isEmpty()) return null; - AbstractEntry entry = (AbstractEntry) ((IStructuredSelection) selection).getFirstElement(); + AbstractEntry entry = (AbstractEntry) selection.getFirstElement(); entry.write(pwriter); pwriter.flush(); textVersion = writer.toString(); @@ -1341,7 +1341,7 @@ public class LogView extends ViewPart implements ILogListener { return; } - ISelection selection = fFilteredTree.getViewer().getSelection(); + IStructuredSelection selection = fFilteredTree.getViewer().getStructuredSelection(); String textVersion = selectionToString(selection); event.data = textVersion; } @@ -1498,7 +1498,7 @@ public class LogView extends ViewPart implements ILogListener { } } - private Comparator getDefaultComparator() { + private Comparator<Object> getDefaultComparator() { return Policy.getComparator(); } diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogViewContentProvider.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogViewContentProvider.java index b04cce7..abda8bc 100644 --- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogViewContentProvider.java +++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogViewContentProvider.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2000, 2007 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogViewLabelProvider.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogViewLabelProvider.java index eee63e0..ef69c57 100644 --- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogViewLabelProvider.java +++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogViewLabelProvider.java @@ -1,9 +1,12 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * Copyright (c) 2000, 2018 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -49,7 +52,7 @@ public class LogViewLabelProvider extends LabelProvider implements ITableLabelPr @Override public void dispose() { - if (consumers.size() == 0) { + if (consumers.isEmpty()) { super.dispose(); } } @@ -122,7 +125,7 @@ public class LogViewLabelProvider extends LabelProvider implements ITableLabelPr public void disconnect(Object consumer) { consumers.remove(consumer); - if (consumers.size() == 0) { + if (consumers.isEmpty()) { dispose(); } } diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/Messages.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/Messages.java index 3788c9d..7235398 100644 --- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/Messages.java +++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/Messages.java @@ -1,121 +1,125 @@ -/*******************************************************************************
- * Copyright (c) 2007, 2013 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- * Jacek Pospychala <jacek.pospychala@pl.ibm.com> - bugs 202583, 207344
- * Benjamin Cabe <benjamin.cabe@anyware-tech.com> - bug 218648
- * Arnaud Mergey <a_mergey@yahoo.fr> - RAP port
- *******************************************************************************/
-package org.eclipse.ui.internal.views.log;
-
-import org.eclipse.rap.rwt.RWT;
-
-public class Messages {
-
- public String LogReader_warn_noEntryWithinMaxLogTailSize;
-
- public String LogView_column_message;
- public String LogView_column_plugin;
- public String LogView_column_date;
- public String LogView_clear;
- public String LogView_clear_tooltip;
- public String LogView_copy;
- public String LogView_delete;
- public String LogView_delete_tooltip;
- public String LogView_export;
- public String LogView_exportLog;
- public String LogView_export_tooltip;
- public String LogView_exportEntry;
- public String LogView_exportLogEntry;
- public String LogView_exportEntry_tooltip;
- public String LogView_import;
- public String LogView_import_tooltip;
- public String LogView_filter;
- public String LogView_readLog_reload;
- public String LogView_readLog_restore;
- public String LogView_readLog_restore_tooltip;
- public String LogView_show_filter_text;
- public String LogView_show_filter_initialText;
-
- public String LogView_SessionStarted;
- public String LogView_severity_error;
- public String LogView_severity_warning;
- public String LogView_severity_info;
- public String LogView_severity_ok;
- public String LogView_confirmDelete_title;
- public String LogView_confirmDelete_message;
- public String LogView_confirmOverwrite_message;
- public String LogView_operation_importing;
- public String LogView_operation_reloading;
- public String LogView_activate;
- public String LogView_AddingBatchedEvents;
- public String LogView_view_currentLog;
- public String LogView_view_currentLog_tooltip;
- public String LogView_properties_tooltip;
-
- public String LogView_FileCouldNotBeFound;
- public String LogView_FilterDialog_title;
- public String LogView_FilterDialog_eventTypes;
- public String LogView_FilterDialog_information;
- public String LogView_FilterDialog_warning;
- public String LogView_FilterDialog_error;
- public String LogView_FilterDialog_limitTo;
- public String LogView_FilterDialog_maxLogTailSize;
- public String LogView_FilterDialog_eventsLogged;
- public String LogView_FilterDialog_allSessions;
- public String LogView_FilterDialog_ok;
- public String LogView_FilterDialog_recentSession;
- public String LogView_GroupBy;
- public String LogView_GroupByNone;
- public String LogView_GroupByPlugin;
- public String LogView_GroupBySession;
- public String LogView_LogFileTitle;
- public String LogView_OpenFile;
- public String LogView_WorkspaceLogFile;
- public String LogView_confirmDelete_deleteButton;
-
- public String LogViewLabelProvider_Session;
- public String LogViewLabelProvider_truncatedMessage;
-
- public String EventDetailsDialog_title;
- public String EventDetailsDialog_plugIn;
- public String EventDetailsDialog_severity;
- public String EventDetailsDialog_date;
- public String EventDetailsDialog_message;
- public String EventDetailsDialog_exception;
- public String EventDetailsDialog_session;
- public String EventDetailsDialog_noStack;
- public String EventDetailsDialog_previous;
- public String EventDetailsDialog_next;
- public String EventDetailsDialog_copy;
- public String EventDetailsDialog_FilterDialog;
- public String EventDetailsDialog_ShowFilterDialog;
-
- public String FilterDialog_Add;
- public String FilterDialog_AddFilterTitle;
- public String FilterDialog_AddFliterLabel;
- public String FilterDialog_EnableFiltersCheckbox;
- public String FilterDialog_FilterShouldntContainSemicolon;
- public String FilterDialog_Remove;
-
- public String OpenLogDialog_title;
- public String OpenLogDialog_message;
- public String OpenLogDialog_cannotDisplay;
-
- public String ImportLogAction_noLaunchHistory;
- public String ImportLogAction_reloadWorkspaceLog;
-
- private static final String BUNDLE_NAME = "org.eclipse.ui.internal.views.log.messages"; //$NON-NLS-1$
-
- public static Messages get() {
- Class clazz = Messages.class;
- Object result = RWT.NLS.getISO8859_1Encoded(BUNDLE_NAME, clazz);
- return (Messages) result;
- }
-
-}
+/******************************************************************************* + * Copyright (c) 2007, 2014 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * IBM Corporation - initial API and implementation + * Jacek Pospychala <jacek.pospychala@pl.ibm.com> - bugs 202583, 207344 + * Benjamin Cabe <benjamin.cabe@anyware-tech.com> - bug 218648 + * Arnaud Mergey <a_mergey@yahoo.fr> - RAP port + *******************************************************************************/ +package org.eclipse.ui.internal.views.log; + +import org.eclipse.osgi.util.NLS; +import org.eclipse.rap.rwt.RWT; + +public class Messages extends NLS { + + public String LogReader_warn_noEntryWithinMaxLogTailSize; + + public String LogView_column_message; + public String LogView_column_plugin; + public String LogView_column_date; + public String LogView_clear; + public String LogView_clear_tooltip; + public String LogView_copy; + public String LogView_delete; + public String LogView_delete_tooltip; + public String LogView_export; + public String LogView_exportLog; + public String LogView_export_tooltip; + public String LogView_exportEntry; + public String LogView_exportLogEntry; + public String LogView_exportEntry_tooltip; + public String LogView_import; + public String LogView_import_tooltip; + public String LogView_filter; + public String LogView_readLog_reload; + public String LogView_readLog_restore; + public String LogView_readLog_restore_tooltip; + public String LogView_show_filter_text; + public String LogView_show_filter_initialText; + + public String LogView_SessionStarted; + public String LogView_severity_error; + public String LogView_severity_warning; + public String LogView_severity_info; + public String LogView_severity_ok; + public String LogView_confirmDelete_title; + public String LogView_confirmDelete_message; + public String LogView_confirmDelete_deleteButton; + public String LogView_confirmOverwrite_message; + public String LogView_operation_importing; + public String LogView_operation_reloading; + public String LogView_activate; + public String LogView_AddingBatchedEvents; + public String LogView_view_currentLog; + public String LogView_view_currentLog_tooltip; + public String LogView_properties_tooltip; + + public String LogView_FileCouldNotBeFound; + public String LogView_FilterDialog_title; + public String LogView_FilterDialog_eventTypes; + public String LogView_FilterDialog_information; + public String LogView_FilterDialog_warning; + public String LogView_FilterDialog_error; + public String LogView_FilterDialog_limitTo; + public String LogView_FilterDialog_maxLogTailSize; + public String LogView_FilterDialog_eventsLogged; + public String LogView_FilterDialog_allSessions; + public String LogView_FilterDialog_ok; + public String LogView_FilterDialog_recentSession; + public String LogView_GroupBy; + public String LogView_GroupByNone; + public String LogView_GroupByPlugin; + public String LogView_GroupBySession; + public String LogView_LogFileTitle; + public String LogView_OpenFile; + public String LogView_WorkspaceLogFile; + + public String LogViewLabelProvider_Session; + public String LogViewLabelProvider_truncatedMessage; + + public String EventDetailsDialog_title; + public String EventDetailsDialog_plugIn; + public String EventDetailsDialog_severity; + public String EventDetailsDialog_date; + public String EventDetailsDialog_message; + public String EventDetailsDialog_exception; + public String EventDetailsDialog_session; + public String EventDetailsDialog_noStack; + public String EventDetailsDialog_previous; + public String EventDetailsDialog_next; + public String EventDetailsDialog_copy; + public String EventDetailsDialog_FilterDialog; + public String EventDetailsDialog_ShowFilterDialog; + + public String FilterDialog_Add; + public String FilterDialog_AddFilterTitle; + public String FilterDialog_AddFliterLabel; + public String FilterDialog_EnableFiltersCheckbox; + public String FilterDialog_FilterShouldntContainSemicolon; + public String FilterDialog_Remove; + + public String OpenLogDialog_title; + public String OpenLogDialog_message; + public String OpenLogDialog_cannotDisplay; + + public String ImportLogAction_noLaunchHistory; + public String ImportLogAction_reloadWorkspaceLog; + + private static final String BUNDLE_NAME = "org.eclipse.ui.internal.views.log.messages"; //$NON-NLS-1$ + + public static Messages get() { + Class clazz = Messages.class; + Object result = RWT.NLS.getISO8859_1Encoded(BUNDLE_NAME, clazz); + return (Messages) result; + } + +} diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/OpenLogDialog.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/OpenLogDialog.java index b11aa42..3cce202 100644 --- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/OpenLogDialog.java +++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/OpenLogDialog.java @@ -1,9 +1,12 @@ /******************************************************************************* - * Copyright (c) 2003, 2013 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * Copyright (c) 2003, 2017 IBM Corporation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation @@ -83,13 +86,13 @@ public final class OpenLogDialog extends TrayDialog { private String getLogSummary() { StringWriter out = new StringWriter(); - PrintWriter writer = new PrintWriter(out); - if (logFile.length() > LogReader.MAX_FILE_LENGTH) { - readLargeFileWithMonitor(writer); - } else { - readFileWithMonitor(writer); + try (PrintWriter writer = new PrintWriter(out)) { + if (logFile.length() > LogReader.MAX_FILE_LENGTH) { + readLargeFileWithMonitor(writer); + } else { + readFileWithMonitor(writer); + } } - writer.close(); return out.toString(); } @@ -157,27 +160,19 @@ public final class OpenLogDialog extends TrayDialog { // reading file within MAX_FILE_LENGTH size void readFile(PrintWriter writer) throws FileNotFoundException, IOException { - BufferedReader bReader = null; - try { - bReader = new BufferedReader(new FileReader(logFile)); + try (BufferedReader bReader = new BufferedReader(new FileReader(logFile))) { + while (bReader.ready()) { writer.println(bReader.readLine()); } - } finally { - try { - if (bReader != null) - bReader.close(); - } catch (IOException e1) { // do nothing - } } } // reading large files void readLargeFile(PrintWriter writer) throws FileNotFoundException, IOException { - RandomAccessFile random = null; boolean hasStarted = false; - try { - random = new RandomAccessFile(logFile, "r"); //$NON-NLS-1$ + try (RandomAccessFile random = new RandomAccessFile(logFile, "r");) { //$NON-NLS-1$ + random.seek(logFile.length() - LogReader.MAX_FILE_LENGTH); for (;;) { String line = random.readLine(); @@ -192,25 +187,16 @@ public final class OpenLogDialog extends TrayDialog { writer.println(line); continue; } - } finally { - try { - if (random != null) - random.close(); - } catch (IOException e1) { // do nothing - } } } private void readLargeFileWithMonitor(final PrintWriter writer) { - IRunnableWithProgress runnable = new IRunnableWithProgress() { - @Override - public void run(IProgressMonitor monitor) { - monitor.beginTask(Messages.get().OpenLogDialog_message, IProgressMonitor.UNKNOWN); - try { - readLargeFile(writer); - } catch (IOException e) { - writer.println(Messages.get().OpenLogDialog_cannotDisplay); - } + IRunnableWithProgress runnable = monitor -> { + monitor.beginTask(Messages.get().OpenLogDialog_message, IProgressMonitor.UNKNOWN); + try { + readLargeFile(writer); + } catch (IOException e) { + writer.println(Messages.get().OpenLogDialog_cannotDisplay); } }; ProgressMonitorDialog dialog = new ProgressMonitorDialog(getParentShell()); @@ -222,15 +208,12 @@ public final class OpenLogDialog extends TrayDialog { } private void readFileWithMonitor(final PrintWriter writer) { - IRunnableWithProgress runnable = new IRunnableWithProgress() { - @Override - public void run(IProgressMonitor monitor) { - monitor.beginTask(Messages.get().OpenLogDialog_message, IProgressMonitor.UNKNOWN); - try { - readFile(writer); - } catch (IOException e) { - writer.println(Messages.get().OpenLogDialog_cannotDisplay); - } + IRunnableWithProgress runnable = monitor -> { + monitor.beginTask(Messages.get().OpenLogDialog_message, IProgressMonitor.UNKNOWN); + try { + readFile(writer); + } catch (IOException e) { + writer.println(Messages.get().OpenLogDialog_cannotDisplay); } }; ProgressMonitorDialog dialog = new ProgressMonitorDialog(getParentShell()); diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/SharedImages.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/SharedImages.java index a927cd6..ac2a167 100644 --- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/SharedImages.java +++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/SharedImages.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2007, 2016 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/TailInputStream.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/TailInputStream.java index bf43b6c..cb4f34b 100644 --- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/TailInputStream.java +++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/TailInputStream.java @@ -1,9 +1,12 @@ /******************************************************************************* * Copyright (c) 2005, 2014 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * IBM Corporation - initial API and implementation diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/messages.properties b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/messages.properties index 0bc22c4..989795d 100644 --- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/messages.properties +++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/messages.properties @@ -1,9 +1,12 @@ ############################################################################### # Copyright (c) 2007, 2016 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 +# +# This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 # which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 # # Contributors: # IBM Corporation - initial API and implementation |