windowbuilder how to highlight a text entry - windowbuilder

in windowbuilder i have a textentry field.
in case the entry is invalid i display the message and want to highlight that it is selected.
the following code works that it does all, but highlighting:
txtSoftwareId.setForeground(SWTResourceManager.getColor(SWT.COLOR_RED));
txtSoftwareId.setText(errorMsg);
txtSoftwareId.selectAll();
txtSoftwareId.setFocus();
txtSoftwareId.showSelection();
if i start typing it will delete the entry as it should. only thing is i would like to highlight.
i tried the background color, but that would change the textfield background but not the text background.
Any ideas how to do that?

I also run into this once, it's a known bug on Windows and 3.X Eclipse platform. Has a workaround, see here.

Related

MS Access: Attachment type symbol shows black backround

I have a small database project where users can attach files to records. Mostly pdf and word docs. I am using the attachment type fields that access provides because I want to get more familiar with them. I have a continuous form that shows the attachment field using the Picture/Symbol view option. Most of the time, but strangely not always, the attachment symbol shows this black background behind its symbol. The black background does not cover the whole field but rather only the picture for the attachment type (Word, PDF etc.). The field itself is set to transparent, which is neccesary for my row highlighting to work. Does anyone know why this is happening? Is it a bug? Some way to fix it? It had worked when I had first set it up but upon restarting my computer and reopening the project they turned black and are now stuck that way. I removed them later for some reason and re-did the whole thing, upon which it seemingly worked but after restarting it went black again. There is no difference between using the view settings Picture/Symbol and Symbol.
Visual Aid:
Update 1:
The black backgrounds are seemingly random. I set the view option to Paperclip, restarted access, then set them to Picture/Symbol again and now I get this:
Closing and opening the file appears to turn the backgrounds black. Changing the view type back and forth inbetween can fix some, but not always.... I'm really not sure what's going on.
Update 2:
The issue is seemingly not affected by transparancy settings. Changing the Background color of the field has no impact either. The issue also persists when making a new form from scratch and adding the Attachment type field to it. It also carries over from one pc to another, so unless both have the same issue in their windows installation I don't think that is the root cause either. Compress & Repair did not help. I am only using one attached file per record.
Update 3:
I have had no luck consistently reproducing the issue. Most of the time, about 80% of it I am estimating, the issue persists. Some days, when launching access, the issue is resolved partially for either the word icon, or the pdf icon. On some days the issue is resolved for all icons as in the picture below. Almost always, after closing and opening access, the issue will immediately reappear for all icons. Closing and opening the form only and keeping the file open is fine, the issue stays resolved. Really not sure how to go about this.
My Access version:
Version 2205 Build 16.0.15225.20028
My Windows install:
Microsoft Windows 10 Pro
10.0.19044 Build 19044
So, updated to windows 11 and the issue is solved. No idea what was wrong exactly but it turns out it was related to the windows install. So, some kind of a bug in Win 10 is my guess, since it was happening on two different machines both running win 10.

Spaces not working on existing span

I have been using froala Editor with Google Chrome and everything is fine. I met a client who uses Firefox who needed to press the space-bar twice in order to get a single space. Pressing it once made the space appear, only to disappear as soon as you start typing the next word.
The issue happens when the content is pre-loaded and the user wants to append text to an existing "<span>" element.
Unlike the guy with this similar question , I am not getting any error at all in my console.
Has anyone ever encountered this issue? How do I resolve it so that my Firefox users can only press space-bar once to get a single space instead of pressing twice?
Thank you in advance for your assistance. If it helps, the client uses the latest Firefox always and so do I.
You can try adding a little css to that span tag, display: inline-block; and then check if it resolves your problem.

Select a part of the property in chrome inspactor css panel

In one of my PCs when I use inspect tool in chrome, I can't select some part of a property or a value, so I have to retype all the value again. As many times as I click on the selected text, the caret doesn't go to the place I need and the selected text doesn't deselect.
the following picture shows what I want and what happens.
There is no problem in another PC.
Both are windows 10 64bit and google chrome 62.
Try holding shift or control while clicking. Haven't tried it, but it may work. My guess is that it's simply a UX workflow that DevTools doesn't handle well.

How to have the Sublime Text console showing color instead of the color codes

I have a build system output in the console. However it is showing color code instead of the actual colorized text.
[37;46;1mTest file: static/tests/casperjs/login/test.js
How can I apply a color theme to the console output?
Thanks!
Unfortunately sublime doesn't support this. I ended up writing a plugin that parses the output and converts it into a colored version (for a subset of colors, ones we use in our testing framework).
If you would like to look into that, or if anyone stumbles upon this in future here are some tips..
I detect output in the plugin with an on_modified event listener and a view
with no name (view.name()). This does not uniquely identify the output pane
so you'll have to do a bit more than that, I found no other easy way (unless
you want to hook into your build plugin and act directly on the view it generates).
To make the color changes, I remove the color codes (view.erase()) and add color to the
regions marked by those codes with view.add_regions(). The colors I add are
ones I manually insert into a custom theme, as again there seems to be no
other way. Also, for some reason it seems you can't add a color with the
exact background of the active theme (it inverts it or something), so I set
the color's backgrounds to something just different.
As you can tell, it's a hacky, ad hoc solution, otherwise I would release it on Github.
You can also check out SublimeREPL, it does console text coloring

"Does not make sense to draw an image" - Warning after upgrade to MountainLion

After I upgraded my programming machine to MountainLion and XCode to the new version I get this warning printed into the console everytime I run my application:
It does not make sense to draw an image when [NSGraphicsContext
currentContext] is nil. This is a programming error. Break on void
_NSWarnForDrawingImageWithNoCurrentContext() to debug. This will be logged only once. This may break in the future.
I'm not using an Image anywhere in my Application and I searched the whole project for an image but couldn't find one. Does anybody know what could cause this?
I'm using 2 nib files btw: One Popover and the Mainwindow. Neither of them contains an image.
Edit:
I found the line when this appears:
[self.popover showRelativeToRect:[appDelegate.menulet frame]
ofView:appDelegate.menulet
preferredEdge:NSMinYEdge];
But none of those object is nil. Any suggestions?
Edit 2:
The Menulet is a NSView subclass btw. So I'm passing a view.
I tried setting the breakpoint but it is called when the nib loads. So it is very non-specific. I created a copy of the nib and then deleted objects from it one by one until the warning went away. In my case, it was an NSOutlineView. But as as soon as I added a new NSOutlineView, the error came back.
I was finally able to remove the warning by rebuilding the entire NIB by hand. Painstaking but it got rid of the warning.
If you have a NSImageView that's initialized in the nib but with no image set (and you draw the image yourself in code) just set it and the warning will be gone.
In my case, it's because the image size is {0,0}, which "doesn't make sense".
Actually, the image is for a NSButton, I change the button's image programmatically. In one case, the button should be empty, so I just set an empty image with [NSImage new].
But the error occurs, then no matter how I change the button's image, the button is always empty.
After setting a size to the empty image, the problem is solved, and I can change the button's image successfully.
In my case the warning resulted in rewriting my menuIcon with a rectangle (Working on a menuBar application). Haven't solved the problem yet, but I know where it came from in my case. If you have a menubar application, check the code which generates your icon.