How to change caret (cursor) blinking rate in NetBeans? - netbeans

How to change caret (cursor) blinking rate in NetBeans? (7.0)
NetBeans developers say that this is supported as a Swing option, see Bug 124211 - Cursor blink rate too fast but I can't figure out the name of this Swing option to set from the command line.
The closest example of setting Swing option that I found is setting look and feel by putting
-J-Dswing.defaultlaf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel to the netbeans.conf.

I realize this is old, but it's quite high up in google search so I thought I'd add an updated solution. The solution above by Tushar Joshi does not work for me in Netbeans 7.1.1. What I had to do, was quite similar though:
Basically, the setting have moved to <userdir>\config\Editors\text\x-java\Preferences\org-netbeans-modules-editor-settings-CustomPreferences.xml.
The path for Unix/Linux is $HOME/.netbeans/<NetbeansVersion>/config/Editors/Preferences/org-netbeans-modules-editor-settings-CustomPreferences.xml.
Exit netbeans and modify the file by adding the entry
<entry javaType="java.lang.Integer" name="caret-blink-rate" xml:space="preserve">
<value>1000</value>
</entry>
The value is the number of milliseconds of blink rate. I added a whole second. I added it so it lined up alphabetically with the other name properties of the other entries, but I don't know if that's important or not. That's it:)

There was a module for customizing the Cursor Blinking Rate created by Emilian Bold, but that module is not found easily available. Let me provide a less intuitive way but this solution works with NetBeans IDE 7.0.1 as tested by me.
Make sure the NetBeans IDE is shut down before making these changes.
Create file <userdir>/config/Editors/text/x-java/properties.xmlHere the <userdir> means the User directory used by NetBeans IDE. This directory can be found from the NetBeans Help > About menu. The config folder will already be there in this directory but the folders Editors/text/x-java may not be there and we will have to create them, they are case sensitive. The properties.xml file shall also be created in the x-java folder.
Add the following contents to the properties.xml file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties PUBLIC "-//NetBeans//DTD Editor Properties settings
1.0//EN" "http://www.netbeans.org/dtds/EditorProperties-1_0.dtd">
<properties>
<property class="java.lang.Integer" name="caret-blink-rate" value="0"/>
</properties>
The value="0" portion can be customized by desired blink rate in miliseconds, the default value used by NetBeans IDE is 300 in my opinion, but it can be changed with a new value, 0 will mean no blinking.
Start NetBeans IDE again and now you will get your desired blink rate for the cursor in Java files.

If you would like to disable it for all editors, instead of just the Java editor, add the following:
<entry javaType="java.lang.Integer" name="caret-blink-rate" xml:space="preserve">
<value>2147483647</value>
</entry>
under the <editor-preferences> element to the file:
config/Editors/Preferences/org-netbeans-modules-editor-settings-CustomPreferences.xml
The full paths are:
On Mac:
~/Library/Application Support/NetBeans/8.2/config/Editors/Preferences/org-netbeans-modules-editor-settings-CustomPreferences.xml
On Windows:
%APPDATA%\NetBeans\8.2\config\Editors\Preferences\org-netbeans-modules-editor-settings-CustomPreferences.xml
Source: https://forums.netbeans.org/topic9561.html

Related

NetBeans IDE scaling on Windows 8/10

I'm trying to run NetBeans under Windows 8.1 on a screen with a high DPI. Windows itself has scaling enabled to 400% and everything else looks just fine.
However, when I start NetBeans, it runs as if there's no scaling enabled and I just see tiny little letters in the IDE. I did check the properties under which the IDE starts and they do have "Enable scaling for this program" checked.
I could increase font size in the editor and the error log, which would at least enable me to view what I'm typing on the screen, however, all menus, side-bars, panels, etc, remain very small which is very uncomfortable trying to work with. So any idea how I can make NetBeans scale with Windows 8.1? Currently using NetBeans 8.0.
Open C:\Program Files\NetBeans 8.0\etc\netbeans.conf
Change -J-Dsun.java2d.dpiaware=true to -J-Dsun.java2d.dpiaware=false
Right click on netbeans icon on desktop.
Choose properties.
Go to Compatibility tab.
Tick Overide high DPI scaling and choose System in dropbox.
Click apply.
Open NetBeans.
Worked on Windows 10 on 4K resolution. Font and buttons are little blurred, but it doesn't bother me much because I am programming not watching movies anyway. Quick fix and easy to undo in case it gets messed up somewhere.
Image
A workaround is to increase the font size of menu options. See: FaqFontSize - NetBeans Wiki
Open C:\Program Files\NetBeans 8.x\etc\netbeans.conf
Locate the line containing netbeans_default_options
Add --fontsize 18 within the quotes. Example: "<other -J options> --fontsize 18"
This will increase the font size within menus, which causes dynamic UI elements to increase in size, effectively a DPI scaling workaround. Only downside is icons/images do not scale.
Unfortunately changing dpiaware setting in the .conf file did not work on my surface 4 pro and Windows 10. I found the solution in a link in the netbeans forum that seems to be an universal solution for all(!) programs that declare to be dpiaware and actually are not (see Dan Antonellis homepage).
The fix is quite simple: First set Windows to prefer external manifest files over internal ones (which was default until some Versions ago) by adding the key
DWORD PreferExternalManifest=1
to
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide
Then create a manifest file (in this case netbeans64.exe.manifest or netbeans.exe.manifest) in the directory of the corresponding exe file with the following content:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0" processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*">
</assemblyIdentity>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.VC90.CRT"
version="9.0.21022.8"
processorArchitecture="amd64"
publicKeyToken="1fc8b3b9a1e18e3b">
</assemblyIdentity>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<ms_windowsSettings:dpiAware xmlns:ms_windowsSettings="http://schemas.microsoft.com/SMI/2005/WindowsSettings">false</ms_windowsSettings:dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
This way I also could fix Visual Studio 2013 and SQL Server Management Console 2012 which are only partly dpi aware (e.g. Visual Studio 2013 the form editor is unusable on 200% as the complete layout is broken). I fixed all my apps that were unusable or at least had a bad layout this way.
Of course, depending on the display and desired size things might get a bit blurry, it is a question of personal preferences (sharpness vs. layout). At least this fix makes essential applications usable on higher dpi settings.
As this thread was the first one in my google results I thought it would be a good idea to post this solution although the last activity is quite long ago.
Windows 10 does this for you now. Right click on your Netbeans shortcut (C:\ProgramData\Microsoft\Windows\Start Menu\Programs\NetBeans) and select Properties.
Go to the Compatibility tab and then select Change High DPI Settings. From there, check the Override High DPI Scaling box and set it to System.
Similar to setting --fontsize 18, if you use the Darcula plugin, you can set the value for the "Override Default Fonts" option to 18. That has the same effect. Additionally, if you change it to Segoe UI, it matches Windows 10 nicely.
go to display settings and change scale and layout to 100%
Boom! :)
Simply hold down the Alt key then scroll up or down to zoom out or in

Spellchecking doesn't work in eclipse with Texlipse

I have installed eclipse Kepler with Texlipse. However, the spellchecking doesn't seem to work. It doesn't mark any words.
I have already:
enabled spellchecking both in the general and the texlipse preferences
downloaded the dictionaries from http://sourceforge.net/projects/texlipse/files/dictionaries/ and set their directory as the directory for both main and user dictionaries in the Texlipse-preferences
copied the wordlists from the eclipse installation and changed the extension to ".dic" and ".dict"
restarted eclipse several times
I am also unable to find an option to start a spellcheck for the whole document, like there usually is.
I had similar problems with the TeXlipse spellchecker. To fix it I followed the instructions from https://stackoverflow.com/a/5736974/2920749
Additionally, I set the language code to en in the project settings as described here: https://stackoverflow.com/a/7064110/2920749.
However, spellchecking still did not work for me under Ubuntu 12.04.
I had to switch to a monospaced font to get it working.
Also make sure that the dictionaries are uncompressed.
Check that all dictionary files are readable and that you have write access to the user-defined dictionary.
The one thing that did the trick for me was, after having done the same as you did, to go to
Project > Properties > Latex Project Properties
and set the language setting (last entry on the right) to `en' (or whatever language you need).
The interesting thing is that in my case everything worked fine until one day, and suddenly, the project stopped doing the spelling, until I set this value, which turned it on again. I am quite sure that I did not remove this property in the last few days unless there is a secrete short-cut that I mistakenly pressed. So, very weird.
I had a similar problem. I was using Inconsolata font (that I find awesome) and spell check didn't underline wrong words. I then changed font to Dejavu Sans Mono and the underline appeared.
For me changing the font worked, but I found another solution changing the markup type in Window > Preferences > General > Editors > Text Editors > Annotations > Spelling errors
There, you can check the Text as checkbox, select a different option (e.g. highlighted) and click apply to see the changes.
For some reason, in my case, some options are not displaying and some others yes.

try to avoid multiple instances of eclipse editor opening same file

I registered a custom editor with eclipse extension point "org.eclipse.ui.editors" as follows.
<extension
point="org.eclipse.ui.editors">
<editor
class="com.xxx.designer.scxml.ui.ScxmlDiagramEditor"
id="com.xxx.designer.scxml.ui.ScxmlDiagramEditor"
extensions="scdiagram"
name="SCXML Editor">
</editor>
It works fine, this editor is associated with .scdiagram files. However, every time I click on one same .scdiagram file, it opens a new instance for me instead of highlighting the opened file. Any idea on this?
Thanks,
Jie
All you need to do is make your IEditorInput return true for the same files. You could implement this by comparing the canonical names of your files. Don't forget to also override the hashCode() method. What issues should be considered when overriding equals and hashCode in Java?
See Lars Vogel's excellent tutorial Eclipse Editor Plugin Tutorial for more details on using Editors.
Here's how my question was resolved eventually. It's related to Graphiti and solution is also tied to the framework.
Since I subclassed Graphiti's diagram editor, all I need to do is to set org.eclipse.graphiti.ui.editor.DiagramEditorMatchingStrategy as the editor's matching strategy in plugin.xml.

vdoc for php in Netbeans 6.9.1 seems not working

When I insert a vdoc, like discriped here, Netbeans not offers any suggestions:
/* #var $persistenceManager Tx_Extbase_Persistence_Manager */
$persistenceManager = t3lib_div::makeInstance('Tx_Extbase_Persistence_Manager');
$persistenceManager-> // no suggestions here
The switch of variablename and type has not changed the result. What is it, what I'm making wrong or is it just a bug?
My Netbeans Version:
Product Version: NetBeans IDE 6.9.1 (Build 201011082200)
Java: 1.6.0_23; Java HotSpot(TM) Client VM 19.0-b09
System: Windows 7 version 6.1 running on x86; Cp1252; de_DE (nb)
I suppose it is not technically a bug, but it is just as annoying as a mosquito buzzing in your ear. :-)
The expansion of code templates from their abbreviations can be short-circuited by a few things. For example, if you start to type the abbreviation, make a mistake, backspace to erase and correct just a few characters but not the whole thing, then NetBeans won't detect that the abbreviation for the template was typed, and thus won't expand it. A little more commonly, if what you type opens up the auto-completion pop-up first, then the expansion of code templates is also stopped.
When I tried out vdoc, the auto-completion pop-up got in the way for me. Likely, it is the same for you. If you type it quickly enough with the expansion key so that the auto-completion does not pop-up, it will probably work.
Unfortunately, there is no easy switch or setting to control how quickly auto-completion shows up. Fortunately, there is a way to set it. I am assuming from your link and interest in "vdoc" that you are working on PHP files, so we'll set the auto-completion delay for that.
Open windows explorer and go to %USERPROFILE%\.netbeans\config\Editors\text. (%USERPROFILE% can be typed directly into the explorer path bar just like it was a path itself, or you can go to the C:\Users\your-log-in-name directory.)
Unless you already have one (I didn't) create a directory called x-php5
Inside that directory, create a sub-directory called Preferences
Inside that directory, create a text file named:
org-netbeans-modules-editor-settings-CustomPreferences.xml
Open that file with a text editor, and put in the following:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE editor-preferences PUBLIC "-//NetBeans//DTD Editor Preferences 1.0//EN" "http://www.netbeans.org/dtds/EditorPreferences-1_0.dtd">
<editor-preferences>
<entry name="completion-auto-popup-delay" value="3000" />
</editor-preferences>
Save it.
Stop and restart your NetBeans.
Give code template expansion a try.
The completion-auto-popup-delay is set in milliseconds, so the above resets it to three (3) seconds. That is obviously too long to be useful. Once you get the code completion expansion working properly, go back in and edit the XML configuration file, and reduce the delay in increments until you are comfortable that you have both enough time to type and expand a code template, and that your auto-completion pop-up doesn't take an inordinate amount of time to react. It will be a balancing act.
I don't know if it is strictly needed, but I made sure to stop and re-start NetBeans each time I made a change to the XML file.
Also:
Make sure you are typing the correct expansion key(s) after the abbreviation. I changed mine to SHIFT-Space and forgot all about it.
In NetBeans, Click on Tools then Options
In the Options dialog, click on the Editor icon in the toolbar
Click on the Code Templates tab
Check (and if necessary, change) the Expand Template on setting

In Eclipse's text editors, is it possible to have tabs not look the same as spaces

Is it possible to set tabs to have a different background color (e.g. slightly grey) or put a little symbol (like "↦") in Eclipse text editors? If it's language specific, I'm using PHP.
Our company coding standard is Tabs for indenting, but often there are spaces in the source code, so it would be great to see where these spaces are so that I can correct them when working on that bit of the code. I don't want to run a script to just fix them globally because that would break merging in our version control, and they may come back without the developer realising if they copy and paste some sample code or something.
What would be really nice is if it could highlight spaces at the beginning of lines or spaces after tabs with a red background or something. I can sort-of simulate this by doing a regex search for "^|\t +", but that also highlights the tab itself, and I'd like this to be permanently highlighted, even when I am using the search for other things.
In the preferences dialog: General -> Editors -> Text Editors : Show whitespace characters.
(This works in Eclipse 3.5 at least).
You need an external plugin for that.
The following uses Checkstyle (for Java) for illustration.
But you can use phpcheckstyle (same idea, but you need to patch that oppen source to add the regex detection. See the forum for patch examples)
^[\t]*? [\t ]*?\S.*?$
alt text http://img825.imageshack.us/img825/390/eclipsecsspace.png
Use the following module:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "configuration_1_3.dtd">
<!--
This configuration file was written by the eclipse-cs plugin configuration editor
-->
<!--
Checkstyle-Configuration: t
Description: none
-->
<module name="Checker">
<property name="severity" value="warning"/>
<module name="TreeWalker">
<module name="Regexp">
<property name="format" value="^[\t]*? [\t ]*?\S.*?$"/>
<property name="message" value="spaces are used instead of tab for indent"/>
<property name="illegalPattern" value="true"/>
</module>
</module>
</module>
Note the configuration_1_3.dtd: you need one dtd if you can't access the one originally written in the module xml file (http://www.puppycrawl.com/dtds/configuration_1_2.dtd: see Module XML configuration)