swing on views [message #98942] |
Thu, 21 July 2005 07:03  |
Eclipse User |
|
|
|
Originally posted by: newshuntertr.hotmail.com
can i use swing components on ViewPart? it is disabled to drag&drop a
swing component from toolbar to the viewpart on VE.
--
-------------
-News Hunter-
-------------
|
|
|
|
|
|
|
|
|
Re: swing on views [message #99247 is a reply to message #99187] |
Fri, 22 July 2005 10:34  |
Eclipse User |
|
|
|
Originally posted by: jdstinto.us.ibm.com
Make sure you create a plugin project to try the below example out. It
seems like it works, but I didn't get a chance to play with it too much.
There a two ways to use the viewer, let it create its own combo, or
create a combo and give it to him. Then you just add objects like a
list and it will try to figure out how to display them for you.
Hope that helps!
-Jon
> i need combo items as an object not just a string. like swing combo uses
> renderer for its data object i will need viewer property of jface as rich
> said. it is too hard to find an example about comboviewer.
>
> On Thu, 21 Jul 2005 11:21:44 -0400, Jonathan Stinton wrote:
>
>
>>Not sure I understand what you mean by "value feature." Neither JComboBox
>>nor SWT Combo has a value (at least by that name). There is also a CCombo
>>box that is in the SWT Custom library. But that is very similiar to the
>>others.
>>
>>If you could elaborate a little more on the methods you use from Swing I
>>might be able to be of more assistance.
>>
>>Thanks,
>>Jon
>
>
try this out:
import org.eclipse.jface.viewers.ComboViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Shell;
public class ComboTest {
private Shell sShell = null;
private Combo combo = null;
private ComboViewer myViewer = null;
/**
* This method initializes sShell
*/
private void createSShell() {
sShell = new Shell();
sShell.setText("Shell");
createCombo();
sShell.setSize(new Point(300, 200));
}
/**
* This method initializes combo
*
*/
private void createCombo() {
combo = new Combo(sShell, SWT.NONE);
combo.setBounds(new org.eclipse.swt.graphics.Rectangle(67,53,88,36));
myViewer = new ComboViewer(combo);
myViewer.add("Text");
myViewer.add(new Integer(9));
}
}
|
|
|
Re: swing on views [message #609161 is a reply to message #98942] |
Thu, 21 July 2005 09:10  |
Eclipse User |
|
|
|
Currently you must use SWT controls for RCP applications. We do not yet
have any wrapper feature that will allow the use of Swing or AWT on top
of them. The same applies for straight SWT apps.
Thanks,
Jon
News Hunter wrote:
> can i use swing components on ViewPart? it is disabled to drag&drop a
> swing component from toolbar to the viewpart on VE.
>
|
|
|
Re: swing on views [message #609166 is a reply to message #98986] |
Thu, 21 July 2005 10:00  |
Eclipse User |
|
|
|
Originally posted by: newshuntertr.hotmail.com
some swt components limit me so much. for example combo has just text and
index feature. i need also value feature like swing component has. can i
find any swt component that has more features?
On Thu, 21 Jul 2005 09:10:56 -0400, Jonathan Stinton wrote:
> Currently you must use SWT controls for RCP applications. We do not yet
> have any wrapper feature that will allow the use of Swing or AWT on top of
> them. The same applies for straight SWT apps.
>
> Thanks,
> Jon
> --
-------------
-News Hunter-
-------------
|
|
|
Re: swing on views [message #609169 is a reply to message #99015] |
Thu, 21 July 2005 11:21  |
Eclipse User |
|
|
|
Not sure I understand what you mean by "value feature." Neither
JComboBox nor SWT Combo has a value (at least by that name). There is
also a CCombo box that is in the SWT Custom library. But that is very
similiar to the others.
If you could elaborate a little more on the methods you use from Swing I
might be able to be of more assistance.
Thanks,
Jon
> some swt components limit me so much. for example combo has just text and
> index feature. i need also value feature like swing component has. can i
> find any swt component that has more features?
>
> On Thu, 21 Jul 2005 09:10:56 -0400, Jonathan Stinton wrote:
>
>
>>Currently you must use SWT controls for RCP applications. We do not yet
>>have any wrapper feature that will allow the use of Swing or AWT on top of
>>them. The same applies for straight SWT apps.
>>
>>Thanks,
>>Jon
>>--
>
> -------------
>
> -News Hunter-
>
> -------------
|
|
|
Re: swing on views [message #609170 is a reply to message #99015] |
Thu, 21 July 2005 11:24  |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
If you are in an RCP app, you should have JFace available, in that case
you could try the ComboViewer. That works on content providers instead
of a list of strings.
News Hunter wrote:
> some swt components limit me so much. for example combo has just text and
> index feature. i need also value feature like swing component has. can i
> find any swt component that has more features?
>
> On Thu, 21 Jul 2005 09:10:56 -0400, Jonathan Stinton wrote:
>
>
>>Currently you must use SWT controls for RCP applications. We do not yet
>>have any wrapper feature that will allow the use of Swing or AWT on top of
>>them. The same applies for straight SWT apps.
>>
>>Thanks,
>>Jon
>>--
>
> -------------
>
> -News Hunter-
>
> -------------
>
>
>
>
--
Thanks,
Rich Kulp
|
|
|
Re: swing on views [message #609176 is a reply to message #99074] |
Fri, 22 July 2005 07:55  |
Eclipse User |
|
|
|
Originally posted by: newshuntertr.hotmail.com
as i examined api it seems comboviewer will solve my problem.where can i
find an example about its usage?
On Thu, 21 Jul 2005 11:24:11 -0400, Rich Kulp wrote:
> If you are in an RCP app, you should have JFace available, in that case
> you could try the ComboViewer. That works on content providers instead of
> a list of strings.
>
--
-------------
-News Hunter-
-------------
|
|
|
Re: swing on views [message #609177 is a reply to message #99059] |
Fri, 22 July 2005 07:57  |
Eclipse User |
|
|
|
Originally posted by: newshuntertr.hotmail.com
i need combo items as an object not just a string. like swing combo uses
renderer for its data object i will need viewer property of jface as rich
said. it is too hard to find an example about comboviewer.
On Thu, 21 Jul 2005 11:21:44 -0400, Jonathan Stinton wrote:
> Not sure I understand what you mean by "value feature." Neither JComboBox
> nor SWT Combo has a value (at least by that name). There is also a CCombo
> box that is in the SWT Custom library. But that is very similiar to the
> others.
>
> If you could elaborate a little more on the methods you use from Swing I
> might be able to be of more assistance.
>
> Thanks,
> Jon
--
-------------
-News Hunter-
-------------
|
|
|
Re: swing on views [message #609181 is a reply to message #99187] |
Fri, 22 July 2005 10:34  |
Eclipse User |
|
|
|
Make sure you create a plugin project to try the below example out. It
seems like it works, but I didn't get a chance to play with it too much.
There a two ways to use the viewer, let it create its own combo, or
create a combo and give it to him. Then you just add objects like a
list and it will try to figure out how to display them for you.
Hope that helps!
-Jon
> i need combo items as an object not just a string. like swing combo uses
> renderer for its data object i will need viewer property of jface as rich
> said. it is too hard to find an example about comboviewer.
>
> On Thu, 21 Jul 2005 11:21:44 -0400, Jonathan Stinton wrote:
>
>
>>Not sure I understand what you mean by "value feature." Neither JComboBox
>>nor SWT Combo has a value (at least by that name). There is also a CCombo
>>box that is in the SWT Custom library. But that is very similiar to the
>>others.
>>
>>If you could elaborate a little more on the methods you use from Swing I
>>might be able to be of more assistance.
>>
>>Thanks,
>>Jon
>
>
try this out:
import org.eclipse.jface.viewers.ComboViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Shell;
public class ComboTest {
private Shell sShell = null;
private Combo combo = null;
private ComboViewer myViewer = null;
/**
* This method initializes sShell
*/
private void createSShell() {
sShell = new Shell();
sShell.setText("Shell");
createCombo();
sShell.setSize(new Point(300, 200));
}
/**
* This method initializes combo
*
*/
private void createCombo() {
combo = new Combo(sShell, SWT.NONE);
combo.setBounds(new org.eclipse.swt.graphics.Rectangle(67,53,88,36));
myViewer = new ComboViewer(combo);
myViewer.add("Text");
myViewer.add(new Integer(9));
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.06852 seconds