Unverified Commit 387759c9 authored by Neil C Smith's avatar Neil C Smith Committed by GitHub
Browse files

Merge pull request #4506 from apache/delivery

Sync delivery to release150 for 15-rc4
parents 8156d3f8 ceffbbc8
......@@ -267,16 +267,18 @@ public final class GradleBaseProject implements Serializable, ModuleSearchSuppor
}
/**
* Returns {@code true} if all configurations are resolved.
* @return true - if all configurations are resolved.
* Returns {@code true} if all resolvable configurations are resolved.
* @return true - if all resolvable configurations are resolved.
*/
public boolean isResolved() {
if (resolved == null) {
boolean b = true;
for (GradleConfiguration value : configurations.values()) {
b &= value.isResolved();
if (!b) {
break;
if (value.isCanBeResolved()) {
b &= value.isResolved();
if (!b) {
break;
}
}
}
resolved = b;
......
......@@ -356,14 +356,16 @@ public class NbDdeBrowserImpl extends ExtBrowserImpl {
}
logFine("urlstr:", urlStr); // NOI18N
StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage (NbDdeBrowserImpl.class, "MSG_activatingBrowser"));
try {
task.browser.reqDdeMessage(task.browser.realDDEServer(),WWW_ACTIVATE,"-1,0x0",task.browser.getActivateTimeout());
} catch (NbBrowserException ex) {
logFine("Exception, gonna start browser:", ex);
triedStart = true;
startBrowser(task.browser.extBrowserFactory.getBrowserExecutable(), urlStr);
}
if (!win9xHack(task.browser.realDDEServer())) {
StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage (NbDdeBrowserImpl.class, "MSG_activatingBrowser"));
try {
task.browser.reqDdeMessage(task.browser.realDDEServer(),WWW_ACTIVATE,"-1,0x0",task.browser.getActivateTimeout());
} catch (NbBrowserException ex) {
logFine("Exception, gonna start browser:", ex);
triedStart = true;
startBrowser(task.browser.extBrowserFactory.getBrowserExecutable(), urlStr);
}
}
logFine("firstpart"); // NOI18N
if (!triedStart) {
......@@ -443,6 +445,15 @@ public class NbDdeBrowserImpl extends ExtBrowserImpl {
return url;
}
/**
* Checks for IExplorer & Win9x combination.
*/
private boolean win9xHack (String browser) {
return browser.equals(ExtWebBrowser.IEXPLORE)
&& (Utilities.getOperatingSystem() == Utilities.OS_WIN98
|| Utilities.getOperatingSystem() == Utilities.OS_WIN95);
}
/**
* Utility function that tries to start new browser process.
*
......
......@@ -748,7 +748,7 @@ Link to<A HREF="overview-summary.html">Non-frame version.</A>
<!-- possibly after filtering for duplicates or something like this. -->
<!-- Timeout is ten minutes; should be enough for valid start, while preventing -->
<!-- a deadlock from hanging an automated build: -->
<exec os="Windows NT Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes" timeout="600000">
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes" timeout="600000">
<arg value="--jdkhome"/>
<arg file="${nbjdk.home}"/>
<arg value="--userdir"/>
......@@ -828,7 +828,7 @@ Link to<A HREF="overview-summary.html">Non-frame version.</A>
>
<property name="tryme.debug.args" value="" />
<exec os="Windows NT Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes">
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes">
<arg value="--jdkhome"/>
<arg file="${nbjdk.home}"/>
<arg value="--userdir"/>
......
......@@ -748,7 +748,7 @@ PKGINST=${pkg.svr4.pkginst}</echo>
<!-- possibly after filtering for duplicates or something like this. -->
<!-- Timeout is ten minutes; should be enough for valid start, while preventing -->
<!-- a deadlock from hanging an automated build: -->
<exec os="Windows NT Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes" timeout="600000">
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes" timeout="600000">
<arg value="--jdkhome"/>
<arg file="${nbjdk.home}"/>
<arg value="--userdir"/>
......@@ -828,7 +828,7 @@ It is possible to use -Ddebug.port=3234 -Ddebug.pause=y to start the system in d
>
<property name="tryme.debug.args" value="" />
<exec os="Windows NT Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes">
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes">
<arg value="--jdkhome"/>
<arg file="${nbjdk.home}"/>
<arg value="--userdir"/>
......
......@@ -748,7 +748,7 @@ Link to<A HREF="overview-summary.html">Non-frame version.</A>
<!-- possibly after filtering for duplicates or something like this. -->
<!-- Timeout is ten minutes; should be enough for valid start, while preventing -->
<!-- a deadlock from hanging an automated build: -->
<exec os="Windows NT Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes" timeout="600000">
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes" timeout="600000">
<arg value="--jdkhome"/>
<arg file="${nbjdk.home}"/>
<arg value="--userdir"/>
......@@ -828,7 +828,7 @@ Link to<A HREF="overview-summary.html">Non-frame version.</A>
>
<property name="tryme.debug.args" value="" />
<exec os="Windows NT Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes">
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes">
<arg value="--jdkhome"/>
<arg file="${nbjdk.home}"/>
<arg value="--userdir"/>
......
......@@ -748,7 +748,7 @@ PKGINST=${pkg.svr4.pkginst}</echo>
<!-- possibly after filtering for duplicates or something like this. -->
<!-- Timeout is ten minutes; should be enough for valid start, while preventing -->
<!-- a deadlock from hanging an automated build: -->
<exec os="Windows NT Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes" timeout="600000">
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes" timeout="600000">
<arg value="--jdkhome"/>
<arg file="${nbjdk.home}"/>
<arg value="--userdir"/>
......@@ -828,7 +828,7 @@ It is possible to use -Ddebug.port=3234 -Ddebug.pause=y to start the system in d
>
<property name="tryme.debug.args" value="" />
<exec os="Windows NT Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes">
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows 2003 Windows XP" executable="${netbeans.dest.abs}/bin/nb.exe" failonerror="yes">
<arg value="--jdkhome"/>
<arg file="${nbjdk.home}"/>
<arg value="--userdir"/>
......
......@@ -3380,6 +3380,8 @@ public final class JavaCompletionTask<T> extends BaseTask {
addAllStaticMemberNames(env);
}
final TypeElement enclClass = scope.getEnclosingClass();
List<ExecutableElement> methodsIn = null;
for (Element e : locals) {
switch (simplifyElementKind(e.getKind())) {
case ENUM_CONSTANT:
......@@ -3399,8 +3401,11 @@ public final class JavaCompletionTask<T> extends BaseTask {
}
break;
case METHOD:
if (methodsIn == null) {
methodsIn = ElementFilter.methodsIn(locals);
}
ExecutableType et = (ExecutableType) asMemberOf(e, enclClass != null ? enclClass.asType() : null, types);
if (e.getEnclosingElement() != enclClass && conflictsWithLocal(e.getSimpleName(), enclClass, locals)) {
if (e.getEnclosingElement() != enclClass && conflictsWithLocalMethods(e.getSimpleName(), enclClass, methodsIn)) {
results.add(itemFactory.createStaticMemberItem(env.getController(), (DeclaredType)e.getEnclosingElement().asType(), e, et, false, anchorOffset, elements.isDeprecated(e), env.addSemicolon()));
} else {
results.add(itemFactory.createExecutableItem(env.getController(), (ExecutableElement) e, et, anchorOffset, null, env.getScope().getEnclosingClass() != e.getEnclosingElement(), elements.isDeprecated(e), false, env.addSemicolon(), isOfSmartType(env, getCorrectedReturnType(env, et, (ExecutableElement) e, enclClass != null ? enclClass.asType() : null), smartTypes), env.assignToVarPos(), false));
......@@ -6216,9 +6221,9 @@ public final class JavaCompletionTask<T> extends BaseTask {
}
return false;
}
private boolean conflictsWithLocal(Name name, TypeElement enclClass, Iterable<? extends Element> locals) {
for (ExecutableElement local : ElementFilter.methodsIn(locals)) {
private static boolean conflictsWithLocalMethods(Name name, TypeElement enclClass, List<ExecutableElement> methodsIn) {
for (ExecutableElement local : methodsIn) {
if (local.getEnclosingElement() == enclClass && name.contentEquals(local.getSimpleName())) {
return true;
}
......
......@@ -19,6 +19,7 @@
package org.netbeans.modules.java.hints.bugs;
import com.sun.source.tree.Tree.Kind;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import javax.lang.model.element.ElementKind;
......@@ -46,11 +47,18 @@ public class Unused {
@TriggerTreeKind(Kind.COMPILATION_UNIT)
public static List<ErrorDescription> unused(HintContext ctx) {
return UnusedDetector.findUnused(ctx.getInfo(), () -> ctx.isCanceled())
.stream()
.map(ud -> convertUnused(ctx, ud))
.filter(err -> err != null)
.collect(Collectors.toList());
List<UnusedDescription> unused = UnusedDetector.findUnused(ctx.getInfo(), () -> ctx.isCanceled());
List<ErrorDescription> result = new ArrayList<>(unused.size());
for (UnusedDescription ud : unused) {
if (ctx.isCanceled()) {
break;
}
ErrorDescription err = convertUnused(ctx, ud);
if (err != null) {
result.add(err);
}
}
return result;
}
@Messages({
......
......@@ -112,7 +112,7 @@
depends="create-userdir,add-userdir">
<echo>Warmup 1 - running IDE once to prime disk and memory caches and create userdir</echo>
<exec os="Windows NT Windows 2000 Windows XP"
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows XP"
executable="${netbeans.home}/bin/runide.exe" failonerror="yes" timeout="600000">
<arg value="-J-Dnetbeans.close=true"/>
</exec>
......@@ -123,7 +123,7 @@
</exec>
<echo>Warmup 2 - running IDE a second time prime disk and memory caches and create userdir</echo>
<exec os="Windows NT Windows 2000 Windows XP"
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows XP"
executable="${netbeans.home}/bin/runide.exe" failonerror="yes" timeout="600000">
<arg value="-J-Dnetbeans.close=true"/>
</exec>
......@@ -305,7 +305,7 @@ Copying ide.log</echo>
<target name="runide-freshuserdir" depends="delete-userdir,create-userdir,runide" />
<target name="runide" description="Start the IDE with the userdir specified in the userdir property">
<exec os="Windows NT Windows 2000 Windows XP"
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows XP"
executable="${netbeans.home}/bin/runide.exe" failonerror="yes" timeout="600000"
output="${gclog}_${index}">
</exec>
......
......@@ -18,9 +18,10 @@
# {0} - class name of exception
# {1} - path to system folder
NTF_ExceptionalException=\
A {0} exception has occurred.\n\
Please report this at https://netbeans.apache.org/nb/report-issue,\n\
including a copy of your messages.log file as an attachment.\n\
The messages.log file is located in your {1} folder.
A <code>{0}</code> has occurred.<br/><br/>\
If you are running the <a href="https://netbeans.apache.org/download">latest</a> version of NetBeans you can \
<a href="https://netbeans.apache.org/nb/report-issue">report this</a>, \
including a copy of your messages.log file as an attachment.<br/><br/>\
The messages.log file is located in <a href="{1}">this folder</a>.
NTF_ExceptionalExceptionReport=Show and Report Problem to NetBeans Team
NTF_ExceptionalExceptionReport=Show Details
......@@ -28,7 +28,7 @@ fi
appSigningIdentity="$1"
appDir="$2"
nativeExecutionBinaries=( "/netbeans/ide/bin/nativeexecution/MacOSX-x86/unbuffer.dylib" "/netbeans/ide/bin/nativeexecution/MacOSX-x86/pty" "/netbeans/ide/bin/nativeexecution/MacOSX-x86/pty_open" "/netbeans/ide/bin/nativeexecution/MacOSX-x86/process_start" "/netbeans/ide/bin/nativeexecution/MacOSX-x86/killall" "/netbeans/ide/bin/nativeexecution/MacOSX-x86/stat" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/unbuffer.dylib" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/pty" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/pty_open" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/process_start" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/killall" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/stat")
nativeExecutionBinaries=( "/netbeans/ide/bin/nativeexecution/MacOSX-x86/unbuffer.dylib" "/netbeans/ide/bin/nativeexecution/MacOSX-x86/pty" "/netbeans/ide/bin/nativeexecution/MacOSX-x86/pty_open" "/netbeans/ide/bin/nativeexecution/MacOSX-x86/process_start" "/netbeans/ide/bin/nativeexecution/MacOSX-x86/killall" "/netbeans/ide/bin/nativeexecution/MacOSX-x86/stat" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/unbuffer.dylib" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/pty" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/pty_open" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/process_start" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/killall" "/netbeans/ide/bin/nativeexecution/MacOSX-x86_64/stat" "/netbeans/ide/modules/lib/aarch64/libjunixsocket-native-2.5.1.dylib" "/netbeans/ide/modules/lib/x86_64/libjunixsocket-native-2.5.1.dylib")
jniBinaries=("/netbeans/platform/modules/lib/aarch64/libjnidispatch-nb.jnilib" "/netbeans/platform/modules/lib/x86_64/libjnidispatch-nb.jnilib")
profilerBinaries=("/netbeans/profiler/lib/deployed/jdk16/mac/libprofilerinterface.jnilib" "/netbeans/profiler/lib/deployed/jdk15/mac/libprofilerinterface.jnilib" )
jansiJar="/netbeans/java/maven/lib/jansi-2.4.0.jar"
......
......@@ -60,6 +60,7 @@ void skipStub(LauncherProperties * props) {
WCHAR * os;
props->status = EXIT_CODE_STUB;
os = appendStringW(NULL, L"It`s only the launcher stub.\nOS: ");
if(is9x()) os = appendStringW(os, L"Windows 9x");
if(isNT()) os = appendStringW(os, L"Windows NT");
if(is2k()) os = appendStringW(os, L"Windows 2000");
if(isXP()) os = appendStringW(os, L"Windows XP");
......
......@@ -634,22 +634,27 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hi, LPSTR lpCmdLine, int nCmd
globalInstance = hInstance;
UNREFERENCED_PARAMETER(lpCmdLine);
initWow64();
if(!createEvents()) {
status = EXIT_CODE_EVENTS_INITIALIZATION_ERROR;
if(is9x()) {
MessageBoxA(0, "Windows 9X platform is not supported", "Message", MB_OK);
status = EXIT_CODE_SYSTEM_ERROR;
} else {
LauncherProperties * props = createLauncherProperties();
createLauncherThread(props);
if(!createGui(props, hInstance, hi, nCmdShow)) {
status = EXIT_CODE_GUI_INITIALIZATION_ERROR;
if(!createEvents()) {
status = EXIT_CODE_EVENTS_INITIALIZATION_ERROR;
} else {
messageLoop(props);
WaitForSingleObject(closingWindowsConfirmed, INFINITE);
LauncherProperties * props = createLauncherProperties();
createLauncherThread(props);
if(!createGui(props, hInstance, hi, nCmdShow)) {
status = EXIT_CODE_GUI_INITIALIZATION_ERROR;
} else {
messageLoop(props);
WaitForSingleObject(closingWindowsConfirmed, INFINITE);
}
status = props->status;
exitCode = props->exitCode;
printStatus(props);
freeLauncherProperties(&props);
}
status = props->status;
exitCode = props->exitCode;
printStatus(props);
freeLauncherProperties(&props);
}
FREE(currentProgressSize);
FREE(totalProgressSize);
......
......@@ -36,6 +36,11 @@ void getOSVersion(DWORD *id, DWORD *major, DWORD *minor, DWORD *productType) {
return;
}
DWORD is9x() {
DWORD id, major, minor, type;
getOSVersion(& id, & major, & minor, & type);
return (id == VER_PLATFORM_WIN32_WINDOWS) ? 1 : 0;
}
DWORD isNT() {
DWORD id, major, minor, type;
getOSVersion(& id, & major, & minor, & type);
......
......@@ -24,6 +24,7 @@
extern "C" {
#endif
DWORD is9x();
DWORD isNT();
DWORD isXP();
DWORD is2k();
......
......@@ -52,7 +52,11 @@ class OutWriter extends PrintWriter {
private boolean disposeOnClose = false;
private static final boolean USE_HEAP_STORAGE = Boolean.getBoolean("nb.output.heap");
//IZ 44375 - Memory mapping fails with bad file handle on win 98
private static final boolean USE_HEAP_STORAGE =
Boolean.getBoolean("nb.output.heap") || Utilities.getOperatingSystem() == //NOI18N
Utilities.OS_WIN98 ||
Utilities.getOperatingSystem() == Utilities.OS_WIN95;
/**
* Byte array used to write the line separator after line writes.
......
......@@ -28,13 +28,13 @@ OpenIDE-Module-Long-Description=\
# {0} - class name of exception
# {1} - path to system folder
NTF_ExceptionalException=\
A {0} exception has occurred.\n\
\tClick Show Details or see the messages.log file located in your {1} folder.
A {0} exception has occurred.<br/><br/>\
Click Show Details or see the messages.log file located in your {1} folder.
NTF_ExceptionalExceptionTitle=Unexpected Exception
# {0} - class name of exception
NTF_ExceptionWarning=\
A {0} exception has occurred.\n\
However, the system should continue working without further problems.\n\
A {0} exception has occurred.<br/><br/>\
However, the system should continue working without further problems.<br/><br/>\
Click Show Details for the stack trace.
NTF_ExceptionWarningTitle=Warning
......
......@@ -21,6 +21,7 @@ package org.netbeans.core;
import java.awt.BorderLayout;
import java.awt.Cursor;
import java.awt.Desktop;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.EventQueue;
......@@ -38,6 +39,9 @@ import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.net.URISyntaxException;
import java.nio.file.Paths;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.ResourceBundle;
import java.util.concurrent.Callable;
......@@ -54,10 +58,12 @@ import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextPane;
import javax.swing.SwingUtilities;
import javax.swing.Timer;
import javax.swing.UIManager;
import javax.swing.event.HyperlinkEvent;
import org.netbeans.core.startup.CLIOptions;
import org.openide.DialogDescriptor;
import org.openide.DialogDisplayer;
......@@ -87,7 +93,7 @@ public final class NotifyExcPanel extends JPanel implements ActionListener {
/** preferred width of this component */
private static final int SIZE_PREFERRED_WIDTH=550;
/** preferred height of this component */
private static final int SIZE_PREFERRED_HEIGHT=250;
private static final int SIZE_PREFERRED_HEIGHT=350;
private static final int MAX_STORED_EXCEPTIONS = 500;
private static final boolean AUTO_FOCUS = Boolean.getBoolean("netbeans.winsys.auto_focus"); // NOI18N
......@@ -107,7 +113,7 @@ public final class NotifyExcPanel extends JPanel implements ActionListener {
/** details button */
private JButton details;
/** details window */
private JTextPane output;
private JTextArea output;
/** boolean to show/hide details */
private static boolean showDetails;
......@@ -131,12 +137,13 @@ public final class NotifyExcPanel extends JPanel implements ActionListener {
details = new JButton ();
details.setDefaultCapable (false);
output = new JTextPane() {
output = new JTextArea() {
public @Override boolean getScrollableTracksViewportWidth() {
return false;
}
};
output.setEditable(false);
output.setLineWrap(false);
Font f = output.getFont();
output.setFont(new Font("Monospaced", Font.PLAIN, null == f ? 12 : f.getSize() + 1)); // NOI18N
output.setForeground(UIManager.getColor("Label.foreground")); // NOI18N
......@@ -484,32 +491,41 @@ public final class NotifyExcPanel extends JPanel implements ActionListener {
}
} else {
ResourceBundle curBundle = NbBundle.getBundle (NotifyExcPanel.class);
String message;
if (current.getSeverity() == Level.WARNING) {
// less scary message for warning level
descriptor.setMessage (
java.text.MessageFormat.format(
curBundle.getString("NTF_ExceptionWarning"),
new Object[] {
current.getClassName ()
}
)
message = MessageFormat.format(
curBundle.getString("NTF_ExceptionWarning"),
new Object[] { current.getClassName() }
);
title = curBundle.getString("NTF_ExceptionWarningTitle"); // NOI18N
} else {
// emphasize user-non-friendly exceptions
// if (this.getMessage() == null || "".equals(this.getMessage())) { // NOI18N
descriptor.setMessage (
java.text.MessageFormat.format(
curBundle.getString("NTF_ExceptionalException"),
new Object[] {
current.getClassName (),
CLIOptions.getLogDir ()
}
)
message = MessageFormat.format(
curBundle.getString("NTF_ExceptionalException"),
new Object[] { current.getClassName(), Paths.get(CLIOptions.getLogDir()).toUri() }
);
title = curBundle.getString("NTF_ExceptionalExceptionTitle"); // NOI18N
}
JTextPane pane = new JTextPane();
pane.setContentType("text/html"); // NOI18N
pane.setText(message);
pane.setBackground(UIManager.getColor("Label.background")); // NOI18N
pane.setBorder(BorderFactory.createEmptyBorder());
pane.setEditable(false);
pane.setFocusable(true);
pane.addHyperlinkListener((e) -> {
if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
try {
Desktop.getDesktop().browse(e.getURL().toURI());
} catch (IOException | URISyntaxException ex) {
Exceptions.printStackTrace(ex);
}
}
});
JScrollPane sp = new JScrollPane(pane);
sp.setBorder(BorderFactory.createEmptyBorder());
sp.setPreferredSize(new Dimension(300, 120));
descriptor.setMessage(sp);
}
}
......
......@@ -56,8 +56,12 @@ public final class Utilities {
/** Operating system is Windows NT. */
public static final int OS_WINNT = 1 << 0;
/** Operating system is Windows 95. */
public static final int OS_WIN95 = OS_WINNT << 1;
/** Operating system is Windows 98. */
public static final int OS_WIN98 = OS_WIN95 << 1;
/** Operating system is Solaris. */
public static final int OS_SOLARIS = OS_WINNT << 1;
public static final int OS_SOLARIS = OS_WIN98 << 1;
/** Operating system is Linux. */
public static final int OS_LINUX = OS_SOLARIS << 1;
/** Operating system is HP-UX. */
......@@ -93,7 +97,7 @@ public final class Utilities {
public static final int OS_FREEBSD = OS_OTHER << 1;
/** A mask for Windows platforms. */
public static final int OS_WINDOWS_MASK = OS_WINNT | OS_WIN2000 | OS_WIN_OTHER;
public static final int OS_WINDOWS_MASK = OS_WINNT | OS_WIN95 | OS_WIN98 | OS_WIN2000 | OS_WIN_OTHER;
/** A mask for Unix platforms. */
public static final int OS_UNIX_MASK = OS_SOLARIS | OS_LINUX | OS_HP | OS_AIX | OS_IRIX | OS_SUNOS | OS_TRU64 | OS_MAC | OS_FREEBSD;
......@@ -111,6 +115,10 @@ public final class Utilities {
String osName = System.getProperty ("os.name");
if ("Windows NT".equals (osName)) // NOI18N
operatingSystem = OS_WINNT;
else if ("Windows 95".equals (osName)) // NOI18N
operatingSystem = OS_WIN95;
else if ("Windows 98".equals (osName)) // NOI18N
operatingSystem = OS_WIN98;
else if ("Windows 2000".equals (osName)) // NOI18N
operatingSystem = OS_WIN2000;
else if (osName.startsWith("Windows ")) // NOI18N
......
......@@ -994,6 +994,8 @@ fld public final static int OS_UNIX_MASK = 1709048
fld public final static int OS_UNIX_OTHER = 524288
fld public final static int OS_VMS = 16384
fld public final static int OS_WIN2000 = 8192
fld public final static int OS_WIN95 = 2
fld public final static int OS_WIN98 = 4
fld public final static int OS_WINDOWS_MASK = 303111
anno 0 java.lang.Deprecated()
fld public final static int OS_WINNT = 1
......@@ -1635,6 +1637,8 @@ fld public final static int OS_UNIX_MASK = 1709048
fld public final static int OS_UNIX_OTHER = 524288
fld public final static int OS_VMS = 16384
fld public final static int OS_WIN2000 = 8192
fld public final static int OS_WIN95 = 2
fld public final static int OS_WIN98 = 4
fld public final static int OS_WINDOWS_MASK = 303111
anno 0 java.lang.Deprecated()
fld public final static int OS_WINNT = 1
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment