|
From: Matthias K <mat...@us...> - 2006-04-24 15:50:14
|
Update of /cvsroot/jcommander/plugins/org.jcommander.ui.filepanel/src/org/jcommander/ui/filepanel/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2883/src/org/jcommander/ui/filepanel/actions Modified Files: SimpleOpenURLAction.java Log Message: - Better Layout - Cleaned up code Index: SimpleOpenURLAction.java =================================================================== RCS file: /cvsroot/jcommander/plugins/org.jcommander.ui.filepanel/src/org/jcommander/ui/filepanel/actions/SimpleOpenURLAction.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SimpleOpenURLAction.java 20 Apr 2006 17:05:30 -0000 1.3 --- SimpleOpenURLAction.java 24 Apr 2006 15:50:04 -0000 1.4 *************** *** 12,15 **** --- 12,17 ---- import org.eclipse.jface.viewers.ISelection; import org.eclipse.swt.SWT; + import org.eclipse.swt.graphics.Color; + import org.eclipse.swt.graphics.Point; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; *************** *** 35,64 **** private IWorkbenchWindow window; - - private Combo protokollCombo; - private Combo hostCombo; - private Text userNameText; - private Text userPasswordText; - private Combo dirCombo; ! private String protokoll; ! private String host; ! private String userName; ! private String userPassword; ! private String dir; ! ! private Composite messageArea; ! private Text messageText; ! private boolean messageAreaVisible=false; ! ! private int messageHeight = 60; ! ! protected static final int MAX_URL_HISTORY_SIZE = 20; ! protected static FixedSizeQueue hostHistory = new FixedSizeQueue(MAX_URL_HISTORY_SIZE); ! protected static FixedSizeQueue dirHistory = new FixedSizeQueue(MAX_URL_HISTORY_SIZE); ! ! private class EnterTargetDialog extends TitleAreaDialog { protected EnterTargetDialog(Shell shell) { --- 37,68 ---- private IWorkbenchWindow window; ! private static class EnterTargetDialog extends TitleAreaDialog { ! ! private Combo protokollCombo; ! private Combo hostCombo; ! private Text userNameText; ! private Text userPasswordText; ! private Combo dirCombo; ! private String protokoll; ! private String host; ! private String userName; ! private String userPassword; ! private String dir; ! ! private Composite messageArea; ! private Text messageText; ! ! ! private int messageHeight = 60; ! ! protected static final int MAX_URL_HISTORY_SIZE = 20; ! ! protected static FixedSizeQueue hostHistory = new FixedSizeQueue(MAX_URL_HISTORY_SIZE); ! protected static FixedSizeQueue dirHistory = new FixedSizeQueue(MAX_URL_HISTORY_SIZE); ! ! private boolean messageAreaVisible=false; protected EnterTargetDialog(Shell shell) { *************** *** 68,71 **** --- 72,76 ---- private void createMessageArea(){ if (messageAreaVisible) return; + Point p = getShell().getSize(); messageText = new Text(messageArea,SWT.MULTI|SWT.V_SCROLL|SWT.BORDER|SWT.READ_ONLY); GridData messageTextData = new GridData(); *************** *** 76,86 **** messageTextData.minimumHeight=60; messageText.setLayoutData(messageTextData); ! messageArea.layout(true); ! getShell().layout(true); ! getShell().setSize(getShell().getSize().x, getShell().getSize().y+messageHeight); ! messageArea.layout(true); ! getShell().layout(true); messageAreaVisible=true; ! //messageHeight=messageArea.getSize().y; } --- 81,89 ---- messageTextData.minimumHeight=60; messageText.setLayoutData(messageTextData); ! getShell().pack(); messageAreaVisible=true; ! System.out.println(messageArea.getSize().y); ! messageHeight=messageArea.getSize().y; ! getShell().setSize(p.x, p.y+messageHeight); } *************** *** 141,144 **** --- 144,148 ---- GridLayout messageLayout = new GridLayout(); messageLayout.marginWidth=0; + messageLayout.marginHeight=1; messageArea.setLayout(messageLayout); *************** *** 148,162 **** // @Override protected void okPressed() { - - // if (messageText!=null) { - // messageText.dispose(); - // messageText=null; - // shell.layout(true); - // shell.setSize(shellSize.x, shellSize.y-messageHeight); - // } - // else { - // createMessageArea(); - // } - protokoll=protokollCombo.getText(); userName=userNameText.getText(); --- 152,155 ---- |