I'm writing an Eclipse RCP 3 application. The application contains a menu on the left and the working view on the right. When the application starts the two viewparts are splitting the screen in two parts. Now I'm searching for a way to set the width of the menu so that it not use the full half part of the screen.
I have already done some tests with ISizeProvider but without any luck. What is the easiest way to set a default width on a viewpart?
I can't find anything in the Eclipse source that actually uses the ISizeProvider so it looks like it may have been dropped for Eclipse 4.
If you want to set the relative sizes of views you put then in a Perspective and use the perspective layout factory to set the proportions of the window use by each view.
I started all over again with the mailexample in Eclipse. Now I hava it and without any need to code something.
Related
I'm a beginner and I used absolute layout in my GUI application using Eclipse WindowBuilder. It works just fine most of the time, but when I minimize or maximize the GUI the content either moves to one side of the page or some part of it vanishes. Can you give a solution for this layout problem? Should it auto adjust itself?
I have been a Web Developer for more than 5 years and is now diving into Java as well. I have used NetBeans and its Drag & Drop feature. But due to habbit I like to code everything manually not by NetBean's Drag and Drop.
Everything is perfect but when it comes to put different components on different locations on a JPanel, it becomes really pain to know what co-ordinates for x and y to put components at.
When it's website developing in HTML and CSS, we have many tools like FireFox's FireBug extension etc which help us in adjusting CSS live.
Is there anything for Java as well so we can adjust our component live and then when we know x and y, we can make actual code in Java.
For example, I create a button and put in a jframe, when I run it, I can adjust it's location and then change my actual code.
I don't know it's either possible or not. But as there are Gurus so asking if they would be knowing of some tool.
Don't try to manually set x / y / size of components. Use layout managers and call pack() on your JFrame to size and place your components. Due to differences in screen size and resolution it is very difficult to have your GUI look nice on all systems using manual sizing and placement. Have a try with layout managers and come back with a specific question if you can't get the specific visual look you want.
I am working on a small app, with 3 buttons on left corner(Vertically) and a edit box which covers rest of the screen.
I want to run this app to be able to work on all screen resolutions.
So I have used Relative layout, linear layout and Android:weight for buttons, which equally share the size of the buttons and works fine.
My Question is am I doing it wrong?
Should we design different layouts for different screens or using same layout out but adding properties like weight and padding is fine??
So, you want a responsive layout for your android app.
Pointing to your question :
[+1] layout -> Relative / Linear (in addition to the relative layout)
property (Buttons) -> Android:weight
is the right thing you are doing for your app.
Alternative:
But if you want a more responsive design then you could follow responsive design techniques by using html5 & css3 media queries etc. . And, could opt for a fluid layout also. By doing this the advantages you will have are:
Won't have a native UI only for android but the same could be used for other platforms (iOS,blackberry etc.) if you require.
The design would be more seamless with the native browser and the widgets won't get obsolete ever in the newer versions of your android
platform also and changes once done would be reflected over the other
platforms too.
More info: MUST READ IF YOU WANT CLEAR UNDERSTANDING OF HOW TO DESIGN FOR ANDROID
http://developer.android.com/design/style/devices-displays.html
http://developer.android.com/design/style/metrics-grids.html#48dp-rhythm
you can see this Supporting Multiple Screens and also Designing for Multiple Screens
To support different screen size you have to implement different layout.
Under res directory you should create these directory:
layout
layout-small
layout-large
layout-xlarge
In each directory you implement your layout. be aware to call all the layouts with the same name.
If you want to support the landscape mode too you have to add:
layout-small-land
layout-large-land
layout-land
When, in Eclipse, you open the layout select the tab called 'Graphical Layout' , you will see how your layout will be displayed. Change the screen size using the options in the upper left side and you can check how it will be displayed in different screen size.
If something is wrong you can open the xml using and correct it.
I've created a small tutorial here Multiple screen support
Hope this help you
Views can be pulled out of an Eclipse RCP application into their own floating window. That floating window can have multiple views stacked on top of each other. However, as far as I can tell it cannot show multiple views at the same time in a layout like the main RCP application window.
I've worked around this by creating a new "Window" (see Eclipse RCP application - Create a window programatically). However, this has a number of downsides:
The new window has a menu bar, which I don't really want.
It allows two copies of a view which is marked as not allowing duplicates (one for each window).
Views cannot be dragged between the two windows.
My question: is there any way to configure the behavior of the floating views which Eclipse RCP creates when you pull a view out into its own window so that other views can be docked along side it?
No, this is internal implementation you can't change.
I'm using IntelliJ's UI designer and now I'm stuck as the designer has decided to chop off half of my form. In the UI Designer pane where it shows the components you have added to your form, I can clearly see all my components as expected. But in the main editor window where you see the form itself, IntelliJ has decided to chop off half of it!
Has anyone seen this behavior before and/or know how to resolve it? I have tried doing things like invalidating the cache and restarting IntelliJ several times (which worked once but the problem has come back and I can't seem to resolve it again). I fixed it the one time by restarting IntelliJ and then there was a little anchor to expand the form a little more to reveal the components that were in the white space, but that anchor no longer appears at the bottom of the form to expand.
I am using IntelliJ 9.0.3 Ultimate.
I found the anchors again used to make the form bigger. You can right click the form and choose "Expand Selection" (CTL+W) and then you can increase the size of the form in the editor. I'm not sure why it doesn't expand as you add more components automatically but this solution seems to do the trick.