Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 90823 Details for
Bug 196447
[terminal] The optional terminal input line should be resizeable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
A patch for a better resizable input field
clipboard.txt (text/plain), 4.25 KB, created by
Michael Scharf
on 2008-02-27 00:24:53 EST
(
hide
)
Description:
A patch for a better resizable input field
Filename:
MIME Type:
Creator:
Michael Scharf
Created:
2008-02-27 00:24:53 EST
Size:
4.25 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tm.terminal >Index: src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java,v >retrieving revision 1.17 >diff -u -r1.17 VT100TerminalControl.java >--- src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java 26 Feb 2008 02:43:55 -0000 1.17 >+++ src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java 27 Feb 2008 05:23:44 -0000 >@@ -518,7 +518,7 @@ > GridLayout layout=new GridLayout(); > layout.marginWidth=0; > layout.marginHeight=0; >- >+ layout.verticalSpacing=0; > fWndParent.setLayout(layout); > > ITerminalTextDataSnapshot snapshot=fTerminalModel.makeSnapshot(); >Index: src/org/eclipse/tm/internal/terminal/control/CommandInputFieldWithHistory.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.core/terminal/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/control/CommandInputFieldWithHistory.java,v >retrieving revision 1.9 >diff -u -r1.9 CommandInputFieldWithHistory.java >--- src/org/eclipse/tm/internal/terminal/control/CommandInputFieldWithHistory.java 26 Feb 2008 02:46:42 -0000 1.9 >+++ src/org/eclipse/tm/internal/terminal/control/CommandInputFieldWithHistory.java 27 Feb 2008 05:23:44 -0000 >@@ -8,6 +8,7 @@ > * Contributors: > * Michael Scharf (Wind River) - initial implementation > * Michael Scharf (Wing River) - [211659] Add field assist to terminal input field >+ * Michael Scharf (Wing River) - [196447] The optional terminal input line should be resizeable > *******************************************************************************/ > package org.eclipse.tm.internal.terminal.control; > import java.util.ArrayList; >@@ -24,8 +25,12 @@ > import org.eclipse.swt.events.KeyEvent; > import org.eclipse.swt.events.KeyListener; > import org.eclipse.swt.graphics.Font; >+import org.eclipse.swt.graphics.Rectangle; > import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Event; >+import org.eclipse.swt.widgets.Listener; >+import org.eclipse.swt.widgets.Sash; > import org.eclipse.swt.widgets.Text; > import org.eclipse.ui.fieldassist.ContentAssistCommandAdapter; > >@@ -108,6 +113,7 @@ > * The input text field. > */ > private Text fInputField; >+ private Sash fSash; > public CommandInputFieldWithHistory(int maxHistorySize) { > fMaxSize=maxHistorySize; > } >@@ -200,8 +206,31 @@ > fEditedHistory=null; > fEditHistoryPos=0; > } >- public void createControl(Composite parent,final ITerminalViewControl terminal) { >- fInputField=new Text(parent, SWT.SINGLE|SWT.BORDER); >+ public void createControl(final Composite parent,final ITerminalViewControl terminal) { >+// fSash = new Sash(parent,SWT.HORIZONTAL|SWT.SMOOTH); >+ fSash = new Sash(parent,SWT.HORIZONTAL); >+ final GridData gd_sash = new GridData(SWT.FILL, SWT.CENTER, true, false); >+ gd_sash.heightHint=5; >+ fSash.setLayoutData(gd_sash); >+ fSash.addListener (SWT.Selection, new Listener () { >+ public void handleEvent (Event e) { >+ // no idea why this is needed >+ GridData gdata = (GridData) fInputField.getLayoutData(); >+ Rectangle sashRect = fSash.getBounds (); >+ Rectangle containerRect = parent.getClientArea (); >+ >+ int h=fInputField.getLineHeight(); >+ // make sure the input filed hight is a multiple of the line height >+ gdata.heightHint = Math.max(((containerRect.height-e.y-sashRect.height)/h)*h,h); >+ // do not show less then one line >+ e.y=Math.min(e.y,containerRect.height-h); >+ fInputField.setLayoutData(gdata); >+ parent.layout(); >+ // else the content assist icon will be replicated >+ parent.redraw(); >+ } >+ }); >+ fInputField=new Text(parent, SWT.MULTI|SWT.BORDER|SWT.WRAP|SWT.V_SCROLL); > GridData data=new GridData(SWT.FILL, SWT.FILL, true, false); > boolean installDecoration=true; > if(installDecoration) { >@@ -262,6 +291,8 @@ > fInputField.getParent().layout(true); > } > public void dispose() { >+ fSash.dispose(); >+ fSash=null; > fInputField.dispose(); > fInputField=null;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 196447
:
89609
|
89637
| 90823