I'm trying to set my Eclipse RCP Application's initial size in the suggested way but it doesnt affect the actual size of the window. It doesn't matter what I set the size to the window always appears as fixed with 1020*765 dimensions.
See attached picture (I blanked out some sensitive info). I set the point to 600*400 yet the window appears with the same dimensions. So far no values entered affected the actual size.
I clear the workspace each time and even use -clearPersistedState
Any help would be appreciated
If you are running Eclipse 4.3 or 4.2 this is Eclipse bug 418615 the fix is scheduled for 4.3.2
By Greg's suggestion I looked for a different way and I could manage by using this code. Seems that under 4.3.1 the configurer's initialSize property never gets used but set to 1024*768 by default. This sets the Application window to the display's size:
#Override
public void postWindowOpen() {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setBounds(getDisplaySize());
}
private Rectangle getDisplaySize() {
try {
Display display = Display.getCurrent();
Monitor monitor = display.getPrimaryMonitor();
Rectangle rect = monitor.getBounds();
return rect;
}
catch ( Throwable ignore ) {
return new Rectangle(0,0,1024,768);
}
}
Also for a maximized state you can use:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().setMaximized(true);
Related
Unity ver. 2019.4.19
Sorry for editing this question several time, I didn't use the term editor and edit mode correctly and I worte the code wrong. Now I've fixed.
I'm using timeline in my project. I made a custom clip like this to change some properties in matrial.
public override void ProcessFrame(Playable playable, FrameData info, object playerData)
{
GameObject target = GetTargetGameObject();
var renderers = target.GetComponentsInChildren<Renderer>();
foreach (var r in renderers)
{
if (!Application.isPlaying)
{
foreach (var mat in r.sharedMaterials)
{
mat.SetFloat("_SomeProperty", SomeValueChangedByPlaytime(data));
}
}
else
{
// in play mode use r.materials instead
}
}
}
I want to check the effects in timeline while I'm in edit mode, but I don't want to change my material assets by my code.
If I Use
r.sharedMaterials
This will change all matrial assets and this may cause some unexpected effect on unintended objects.
If I Use
r.materials
This will cause error "Instantiating material due to calling renderer.material during edit mode"
So how can I avoid changing matrial asset while still get correct preview in timeline edit mode?
I have a big issue. I develop in eclipse ide environment, mostly on windows but also on linux. This seems to be a general issue.
Before I save my project on eclipse I have certain spaces between functions or in the code somewhere. I don't want to reformat the code that is in place.
However, every single time I try to save my project. Those spaces disappear, and I cannot find the place where I should change this auto-formatting in my eclipse properties.
Please see example bellow:
First of all I don't touch the code but I receive it as bellow and have to make modifications elsewhere. So at the initial state of my file I have somewhere in the code two functions [functionOne, functionTwo]. Those two functions are separated by a new line [NL] and 6 spaces. The problem appears when I save my project and as you can see the two functions are not separated anymore by the same number of spaces.
Before saving my project:
public void functionOne(){
int i = 0;
while(i<150)
{
//blabla...
}
}
NL:123456
public void functionTwo(){
int i = 0;
while(i<150)
{
//blabla...
}
}
After saving my project:
public void functionOne(){
int i = 0;
while(i<150)
{
//blabla...
}
}
NL:1
public void functionTwo(){
int i = 0;
while(i<150)
{
//blabla...
}
}
I'm starting to be sick of this issue and really need help to solve this.
Not forgetting to mention that absolutely no "Save actions" is enabled!
I don't see anything on my format options neither, but I could be wrong.
Could someone please help me to find a solutions to this problem?
Best regards,
Greg
So that wasn't the "Save actions" but some plugin that I was using. Didn't had the time to check which one it is I just uninstalled the rarely/unused once. And for the moment it seems to work. I'll check later if the problem remains/reappears.
Thanks for your help.
Best regards,
Gregory
I'm trying to generate a UItest in Xcode. When I try to swipe UIview I get
an error:
Timestamped Event Matching Error: Failed to find matching element
error window
This also happens if I try to tap UIView.
You should verify that the 'Accessibility' option is enabled for the UIView object you are swiping from, for example:
Usually this issue is observed when the parent element of the element yo want to record is set to isAccessibilityElement = true. In general, you have to have the parent element set to false to access the child element.
For example: if you have a UILabel inside a view, the accessibility should be set to false for the view and set to true for the UILabel.
For recording a new test, I don't think there's a solution yet. But, if you use an extension forcing tap with a test that already exists, works.
Example of use:
extension XCUIElement {
func forceTapElement() {
if self.hittable {
self.tap()
}
else {
let coordinate: XCUICoordinate = self.coordinateWithNormalizedOffset(CGVectorMake(0.0, 0.0))
coordinate.tap()
}
}
}
func testSomethingWithCells() {
let app = XCUIApplication()
let cells = app.tables.cells
sleep(1)
cells.elementBoundByIndex(0).forceTapElement()
}
You can check the original post here:
Xcode UI test - UI Testing Failure - Failed to scroll to visible (by AX action) when tap on Search field "Cancel' button
I've been occasionally running into this problem. Delete the app's directory from DerivedData seems to help.
In Xcode 9.3, where this is apparently still a problem, what I did was:
Quit Xcode
Reset the Simulator's settings (Hardware -> Erase all
contents and settings)
Quit the Simulator
Delete the derived data for the current app
Restart Xcode
Try recording again - it worked this time for me.
A solution that worked for myself was to identify the object differently.
In Xcode 8 I was able to use the following:
XCUIApplication().tables.cells["Camera Roll"].buttons["Camera Roll"].tap()
With Xcode 9 I got the error mentioned in this question. Ended up using the following, which worked (al beit more flakey than the original option)
XCUIApplication().cells.element(boundBy: 1).tap()
Even if you have Accessibility enabled for the element, you have to make sure that it has a unique accessibility identifier. In my case, I had copied & pasted a UISwitch and assigned a different outlet to it, but it kept the same accessibility ID as the original one.
appengine console for local development logs are an eye sore red(like a bunch of errors!!!) by default. How can I change that to standard black for normal log and red for error? If I right click on the console and go to preference, the setting is correct : standard black and error red.
The output from the DevAppServer is sent to stderr, so you need to change the error colour to black.
Note after one year : I do not use 'java.util.logging' anymore. I had have got a strange bug where my thread stopped in the method 'log()'. It was probably a dead lock. I've swith to 'Log4j'.
In order to have the errors logged in red and the infos in black in the eclipse console, you can create your own ConsoleHandler:
public class MyConsoleHandler extends StreamHandler {
private java.util.logging.Formatter formatter = new SimpleFormatter();
public void publish(LogRecord record){
if(record.getLevel().intValue() < Level.WARNING.intValue())
System.out.println(formatter.formatMessage(record));
else
System.err.println(formatter.format(record));
}
}
and use plug it with:
java.util.logging.LogManager.getLogManager().reset();
java.util.logging.Logger.getLogger("").addHandler(new MyConsoleHandler())
I've built a simple application that applies grid-lines to an image or just simple colors for use as desktop wallpaper. The idea is that the desktop icons can be arranged within the grid. The problem is that depending on more things than I understand the actual spacing in pixels seems to be different from system to system. I've learned that at least these things play a factor:
Resolution (duh)
Taskbar size and placement
Fonts
There has to be more than this. Maybe there's some api call that I don't know about?
there are a 1001 ways to get/set this (but I only know 2) :-D
Windows Register:
HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics
values are IconSpacing and IconVerticalSpacing
by code:
using System.Management;
public string GetWinIconSpace()
{
ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2","SELECT * FROM Win32_Desktop");
foreach (ManagementObject wmi in searcher.Get())
{
try
{
return "Desktop Icon Spacing: " + wmi.GetPropertyValue("IconSpacing").ToString();
}
catch { }
}
return "Desktop Icon Spacing: Unknown";
}
and the 3rd that I never tried you can find it here
They might also be a size problem due to scaling algorithm if the requested size of the icon is not available.
(since an icon file is actually a collection of icons, as explained in this thread about Icons and cursors know where they came from, from the The Old New Thing)