| subclassing org.eclipse.jface.window.ApplicationWindow [message #396502] | 
Mon, 08 December 2003 11:17   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
I have subclassed org.eclipse.jface.window.ApplicationWindow and overridden 
the createContents method.  The only problem is my createContents method is 
not being called.  Any ideas?  This is very frustrating. 
 
/* (non-Javadoc) 
 
* @see 
 org.eclipse.jface.window.Window#createContents(org.eclipse.s wt.widgets.Compo 
site) 
 
*/ 
 
public Control createContents(Composite arg0){ 
 
 
getShell().setText("Insight"); 
 
getShell().setImage(Util.getImageRegistry().get("icon")); 
 
 
m_form = new SashForm((org.eclipse.swt.widgets.Composite) arg0, 
SWT.HORIZONTAL | SWT.NULL); 
 
this.getShell().setSize(SHELL_WIDTH, SHELL_HEIGHT); 
 
m_form.setWeights(WEIGHTS); 
 
 
return m_form; 
 
}
 |  
 |  
  | 
 | 
| Re: subclassing org.eclipse.jface.window.ApplicationWindow [message #397928 is a reply to message #396502] | 
Thu, 11 December 2003 13:11   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Originally posted by: d_sebastian.freenet.de 
 
Hi David, 
 
here is a little example with two sashform, titel and statusline but  
without ImageRegistry. 
 
Please pay attention to the main () - method ! 
Dieter 
 
----------------- SNIPP ----------------------------------- 
public class SWTTest extends ApplicationWindow { 
public SWTTest() { 
super(null); 
addStatusLine(); 
} 
protected Control createContents(Composite parent) { 
this.setStatus("Status"); 
getShell().setText("Title"); 
 
// Window-Bounds 
parent.setBounds(100,100,800,500); 
 
// Trennt oben von unten 
SashForm sashUpDown = new SashForm(parent, SWT.VERTICAL); 
 
// *** UP/DOWN 
SashForm sashLeftRight = new SashForm (sashUpDown, SWT.HORIZONTAL); 
new Label(sashUpDown, SWT.BORDER).setText("label 3"); 
 
// Weight for Up-Down-Sash 
int [] weightUpDown = new int[]{80,20}; 
sashUpDown.setWeights(weightUpDown); 
 
// Right/Leht 
// Content für Rechts und Links 
new Label(sashLeftRight, SWT.BORDER).setText("label 1"); 
new Label(sashLeftRight, SWT.BORDER).setText("label 2"); 
 
 
// Weight for Right-Left-Sash 
int [] weightLeftRight = new int[]{20,80}; 
sashLeftRight.setWeights(weightLeftRight); 
 
return sashUpDown; 
} 
	 
 
public static void main(String[] args) { 
SWTTest w = new SWTTest(); 
w.setBlockOnOpen(true); 
w.open(); 
Display.getCurrent().dispose(); 
} 
} 
----------------- SNAPP ----------------------------------- 
 
 
David Havrda wrote: 
> I have subclassed org.eclipse.jface.window.ApplicationWindow and overridden 
> the createContents method.  The only problem is my createContents method is 
> not being called.  Any ideas?  This is very frustrating. 
 > ...
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.75919 seconds