Re: ToggleFullScreenAction fails on MacOS

2018-06-06 Thread Emilian Bold
What I see in ./applemenu/src/org/netbeans/modules/applemenu/layer.xml is that 
the generic action is hidden on macOS:

 
   






That's why you are getting a null.

So, there is no API to call that action on macOS as far as I can tell.

This workaround does the trick (inspired by 
https://gist.github.com/dohpaz42/4200907 ):


@SuppressWarnings({"unchecked", "rawtypes"})
public static void requestToggleFullScreen(Window window)
{
try {
Class appClass = Class.forName("com.apple.eawt.Application");
Class params[] = new Class[]{};

Method getApplication = appClass.getMethod("getApplication", 
params);
Object application = getApplication.invoke(appClass);
Method requestToggleFulLScreen = 
application.getClass().getMethod("requestToggleFullScreen", Window.class);

requestToggleFulLScreen.invoke(application, window);
} catch (Exception e) {
System.out.println("An exception occurred while trying to toggle 
full screen mode");
}
}

requestToggleFullScreen(Frame.getWindows()[0]);

--emi

‐‐‐ Original Message ‐‐‐

On 6 June 2018 5:44 PM, Patrik Karlström  wrote:

> Den ons 6 juni 2018 kl 14:36 skrev Emilian Bold :
> 
> > The actual NPE might help. Maybe you have to create a dummy even and not 
> > send null to actionPerformed?
> > 
> > If it's reproducible you should report it to the bugtracker 
> > https://issues.apache.org/jira/projects/NETBEANS/summary
> > 
> > --emi
> > 
> > ‐‐‐ Original Message ‐‐‐
> > 
> > On 6 June 2018 2:36 PM, Patrik Karlström  wrote:
> > 
> > > Hi,
> > 
> > >
> > 
> > > Actions.forID("Window", 
> > > "org.netbeans.core.windows.actions.ToggleFullScreenAction").actionPerformed(null);
> > 
> > >
> > 
> > > I *think* that I have successfully run the code above on a mac a couple 
> > > of years back, but that might have been before they changed their 
> > > maximize/full screen handling.
> > 
> > >
> > 
> > > Today I noticed that it failed with an NPE on the mac.
> 
> Just noticed that it is the action itself that is null.
> 
> Action a=Actions.forID("Window", 
> "org.netbeans.core.windows.actions.ToggleFullScreenAction");
> 
> results in a==null.
> 
> All this is done on JDK8 171 and NetBeans 8.2, and on what I guess is an up 
> to date Mac.
> 
> How does it work on other Macs?

-
To unsubscribe, e-mail: users-unsubscr...@netbeans.apache.org
For additional commands, e-mail: users-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



A org.openide.util.RequestProcessor$FastItem exception has occurred.

2018-06-06 Thread Luff,Chris
Getting a FastItem exception pretty frequently when there is a syntax error in 
another part of the code.

I simply put the dot after the object and up pops the exception. Any thoughts 
before I log a JIRA.

***STACK TRACE

  Product Version = Apache NetBeans IDE Dev (Build 
incubator-netbeans-release-302-on-20180517)
  Operating System= Mac OS X version 10.13.5 running on x86_64
  Java; VM; Vendor= 10.0.1; Java HotSpot(TM) 64-Bit Server VM 
10.0.1+10; Oracle Corporation
  Runtime = Java(TM) SE Runtime Environment 10.0.1+10
  Java Home   = 
/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home
  System Locale; Encoding = en_US (nb); UTF-8


java.lang.AssertionError: Analyzer error when processing: selectedCellsMap = 
new SelectedCellsMap>(this::fireCustomSelectedCellsListChangeEvent){


(javafx.collections.ListChangeListener> x0) {
super(x0);
}

@Override()
public boolean isCellSelectionEnabled() {
return TableViewArrayListSelectionModel.this.isCellSelectionEnabled();
}
};
at com.sun.tools.javac.util.Assert.error(Assert.java:162)
at com.sun.tools.javac.comp.Analyzer.doAnalysis(Analyzer.java:575)
at com.sun.tools.javac.comp.Analyzer$2.flush(Analyzer.java:546)
at com.sun.tools.javac.comp.Analyzer.flush(Analyzer.java:583)
at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1493)
at com.sun.tools.javac.main.JavaCompiler.flow(JavaCompiler.java:1461)
at com.sun.tools.javac.api.JavacTaskImpl$1.process(JavacTaskImpl.java:497)
at com.sun.tools.javac.api.JavacTaskImpl$Filter.run(JavacTaskImpl.java:644)
at com.sun.tools.javac.api.JavacTaskImpl.analyze(JavacTaskImpl.java:500)
at 
org.netbeans.modules.java.source.nbjavac.parsing.TreeLoader.loadTreeFor(TreeLoader.java:190)
at com.sun.tools.javac.code.Symbol$ParamSymbol.getSimpleName(Symbol.java:1703)
at com.sun.tools.javac.code.Symbol$ParamSymbol.getSimpleName(Symbol.java:1670)
at 
org.netbeans.modules.editor.java.JavaCompletionItem$MethodItem.(JavaCompletionItem.java:1781)
at 
org.netbeans.modules.editor.java.JavaCompletionItem$MethodItem.(JavaCompletionItem.java:1730)
at 
org.netbeans.modules.editor.java.JavaCompletionItem.createExecutableItem(JavaCompletionItem.java:180)
at 
org.netbeans.modules.editor.java.JavaCompletionItemFactory.createExecutableItem(JavaCompletionItemFactory.java:111)
at 
org.netbeans.modules.editor.java.JavaCompletionItemFactory.createExecutableItem(JavaCompletionItemFactory.java:49)
at 
org.netbeans.modules.java.completion.JavaCompletionTask.addMembers(JavaCompletionTask.java:3589)
at 
org.netbeans.modules.java.completion.JavaCompletionTask.insideMemberSelect(JavaCompletionTask.java:1795)
at 
org.netbeans.modules.java.completion.JavaCompletionTask.resolve(JavaCompletionTask.java:358)
at org.netbeans.modules.java.completion.BaseTask.run(BaseTask.java:93)
at 
org.netbeans.modules.java.completion.JavaCompletionTask.run(JavaCompletionTask.java:58)
at 
org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:586)
at 
org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:130)
at 
org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:114)
at 
org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:181)
at 
org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:178)
at 
org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:153)
at 
org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:335)
at 
org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(DataObjectEnvFactory.java:118)
at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:67)
at 
org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:178)
at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:81)
at 
org.netbeans.modules.editor.java.JavaCompletionProvider$JavaCompletionQuery.query(JavaCompletionProvider.java:193)
at 
org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:198)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
Caused: org.openide.util.RequestProcessor$FastItem: task failed due to




CONFIDENTIALITY NOTICE This message and any included attachments are from 
Cerner Corporation and are intended only for the addressee. The information 
contained in this message is confidential and may constitute inside or 
non-public information under international, federal, or state securities laws. 
Unauthorized forwarding, printing, copying, distribution, or use of such 
information is strictly prohibited and may be 

Re: ToggleFullScreenAction fails on MacOS

2018-06-06 Thread Patrik Karlström
Den ons 6 juni 2018 kl 14:36 skrev Emilian Bold :

> The actual NPE might help. Maybe you have to create a dummy even and not
> send null to actionPerformed?
>
> If it's reproducible you should report it to the bugtracker
> https://issues.apache.org/jira/projects/NETBEANS/summary
>
> --emi
>
> ‐‐‐ Original Message ‐‐‐
>
> On 6 June 2018 2:36 PM, Patrik Karlström  wrote:
>
> > Hi,
> >
> > Actions.forID("Window",
> "org.netbeans.core.windows.actions.ToggleFullScreenAction").actionPerformed(null);
> >
> > I *think* that I have successfully run the code above on a mac a couple
> of years back, but that might have been before they changed their
> maximize/full screen handling.
> >
> > Today I noticed that it failed with an NPE on the mac.
>
>
Just noticed that it is the action itself that is null.
Action a=Actions.forID("Window",
"org.netbeans.core.windows.actions.ToggleFullScreenAction");
results in a==null.

All this is done on JDK8 171 and NetBeans 8.2, and on what I guess is an up
to date Mac.
How does it work on other Macs?


ToggleFullScreenAction fails on MacOS

2018-06-06 Thread Patrik Karlström
Hi,

Actions.forID("Window",
"org.netbeans.core.windows.actions.ToggleFullScreenAction").actionPerformed(null);

I *think* that I have successfully run the code above on a mac a couple of
years back, but that might have been before they changed their
maximize/full screen handling.

Today I noticed that it failed with an NPE on the mac.
It works fine on Windows and Linux.

Any ideas?

/Patrik