Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » Painting an SWT Table
Painting an SWT Table [message #93027] Mon, 06 June 2005 17:14 Go to next message
Eclipse UserFriend
Originally posted by: tcnesham.email.uophx.edu

This is a multi-part message in MIME format.

------=_NextPart_000_0068_01C56A91.40813960
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I dropped a table into the VE shell painter and that worked correctly. =
But after I added a new constructor and added some methods the table =
object appears below the shell frame. I want to add some code to the =
class that contains the table, is there a preferred way to do this? =
Should I extend the table/class and add my code there? Is there a bug? =
Perhaps I am mixing the wrong versions? I should mention that I have =
MyEclipse installed. Are these the correct versions to match together?

Eclipse Java Development Tools Version: 3.0.2
Java EMF Model Version: 1.0.2
Visual Editor Version: 1.0.2=20
Eclipse Graphical Editing Framework 3.0.1
EMF Service Data Objects (SDO) Version: 2.0.1
Eclipse Modeling Framework (EMF) Version: 2.0.1

TIA,
Tim

--=20

------=_NextPart_000_0068_01C56A91.40813960
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1491" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I dropped a table into the VE shell =
painter and=20
that worked correctly.&nbsp; But after I added a new constructor and =
added some=20
methods the table object appears below the shell frame.&nbsp;I want to =
add some=20
code to the class that contains the table, is there a preferred way to =
do this?=20
Should I extend the table/class and add my code there?&nbsp; Is there a =
bug?=20
Perhaps I am mixing the wrong versions?&nbsp; I should mention that I =
have=20
MyEclipse installed.&nbsp; Are these the correct versions to match=20
together?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Eclipse Java Development Tools Version: =

3.0.2<BR>Java EMF Model Version: 1.0.2<BR>Visual Editor Version: 1.0.2=20
<BR>Eclipse Graphical Editing Framework 3.0.1<BR>EMF Service Data =
Objects (SDO)=20
Version: 2.0.1<BR>Eclipse Modeling Framework (EMF) Version:=20
2.0.1<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>TIA,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Tim</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><BR>-- <BR></FONT></DIV></BODY></HTML>

------=_NextPart_000_0068_01C56A91.40813960--
Re: Painting an SWT Table [message #93042 is a reply to message #93027] Mon, 06 June 2005 17:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Could you please paste a copy of the code that got generated? That would
help to see what you were trying to do.

TIMOTHY NESHAM wrote:
> I dropped a table into the VE shell painter and that worked correctly.
> But after I added a new constructor and added some methods the table
> object appears below the shell frame. I want to add some code to the
> class that contains the table, is there a preferred way to do this?
> Should I extend the table/class and add my code there? Is there a bug?
> Perhaps I am mixing the wrong versions? I should mention that I have
> MyEclipse installed. Are these the correct versions to match together?
>
> Eclipse Java Development Tools Version: 3.0.2
> Java EMF Model Version: 1.0.2
> Visual Editor Version: 1.0.2
> Eclipse Graphical Editing Framework 3.0.1
> EMF Service Data Objects (SDO) Version: 2.0.1
> Eclipse Modeling Framework (EMF) Version: 2.0.1
> TIA,
> Tim
>
> --

--
Thanks,
Rich Kulp
Re: Painting an SWT Table [message #93055 is a reply to message #93042] Mon, 06 June 2005 19:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tcnesham.email.uophx.edu

As I mentioned, when I bring this up in the VE painter the table object is
actually below a sort of "shadow" of itself. I cannot visually move it
around. I added public PlayersTable(Shell parent, Td td) and run().
Attached are all the files, nothing proprietary.


=======================
/*
* Created on Jun 4, 2005
*
*/
package td;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;


import org.eclipse.swt.widgets.Table;
/**
* @author tcnesham
*
*/
public class PlayersTable extends Composite
{

private Button new_button = null;
private Button delete_button = null;
private Shell sShell;
private Td td;
private Display display;


private Table table = null; //
@jve:decl-index=0:visual-constraint="95,149"
/**
* Custom Constructor
* @param parent
* @param td
*/
public PlayersTable(Shell parent, Td td)
{
super(parent, SWT.PRIMARY_MODAL);
this.td = td;
initialize();
}

/**
* Constructor created by painter
* @param parent
* @param style
*/
public PlayersTable(Composite parent, int style)
{
super(parent, style);
initialize();
}

private void initialize()
{

new_button = new Button(this, SWT.NONE);
delete_button = new Button(this, SWT.NONE);

createTable();

new_button.setBounds(new org.eclipse.swt.graphics.Rectangle(519, 387,
76, 32));
new_button.setText("New");
delete_button.setBounds(new org.eclipse.swt.graphics.Rectangle(601, 387,
76, 32));
delete_button.setText("Delete");
setSize(new org.eclipse.swt.graphics.Point(772, 461));
}

public void run()
{
display = new Display();

sShell.open();
while (!sShell.isDisposed())
{
if (!display.readAndDispatch())
{
display.sleep();
}
}
display.dispose();

}



/**
* This method initializes table
*
*/
private void createTable() {
table = new Table(this, SWT.BORDER);
table.setFont(new
org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Displa y.getDefault(),
"Arial", 10, org.eclipse.swt.SWT.NORMAL));
table.setBounds(new org.eclipse.swt.graphics.Rectangle(54,53,572,156));
}
} // @jve:decl-index=0:visual-constraint="65,-170"


--
Timothy C. Nesham
School: tcnesham@email.uophx.edu
Work: tcnesham@cvty.com

"Rich Kulp" <richkulp@us.NO_SPAM.ibm.com> wrote in message
news:d8215u$8p1$1@news.eclipse.org...
> Could you please paste a copy of the code that got generated? That would
> help to see what you were trying to do.



  • Attachment: td.zip
    (Size: 22.92KB, Downloaded 146 times)
Re: Painting an SWT Table [message #93086 is a reply to message #93055] Mon, 06 June 2005 21:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

You found a very interesting bug in 1.0.2. It works ok in our latest
development drivers of VE 1.1.

The fix is simple, get rid of sShell. It gets confused with the shell.

You really don't want the shell there anyway because the run shouldn't
be done on an instance of the class.

--
Thanks,
Rich Kulp
Re: Painting an SWT Table [message #93115 is a reply to message #93086] Mon, 06 June 2005 21:35 Go to previous message
Eclipse UserFriend
Originally posted by: tcnesham.email.uophx.edu

Great! That did the trick. I should have guessed I could simply call
getShell() without declaring a variable.

--
Timothy C. Nesham
School: tcnesham@email.uophx.edu
Work: tcnesham@cvty.com

"Rich Kulp" <richkulp@us.NO_SPAM.ibm.com> wrote in message
news:d82dhq$pdp$1@news.eclipse.org...
> You found a very interesting bug in 1.0.2. It works ok in our latest
> development drivers of VE 1.1.
>
> The fix is simple, get rid of sShell. It gets confused with the shell.
>
> You really don't want the shell there anyway because the run shouldn't
> be done on an instance of the class.
>
> --
> Thanks,
> Rich Kulp
Re: Painting an SWT Table [message #607891 is a reply to message #93027] Mon, 06 June 2005 17:29 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Could you please paste a copy of the code that got generated? That would
help to see what you were trying to do.

TIMOTHY NESHAM wrote:
> I dropped a table into the VE shell painter and that worked correctly.
> But after I added a new constructor and added some methods the table
> object appears below the shell frame. I want to add some code to the
> class that contains the table, is there a preferred way to do this?
> Should I extend the table/class and add my code there? Is there a bug?
> Perhaps I am mixing the wrong versions? I should mention that I have
> MyEclipse installed. Are these the correct versions to match together?
>
> Eclipse Java Development Tools Version: 3.0.2
> Java EMF Model Version: 1.0.2
> Visual Editor Version: 1.0.2
> Eclipse Graphical Editing Framework 3.0.1
> EMF Service Data Objects (SDO) Version: 2.0.1
> Eclipse Modeling Framework (EMF) Version: 2.0.1
> TIA,
> Tim
>
> --

--
Thanks,
Rich Kulp
Re: Painting an SWT Table [message #607892 is a reply to message #93042] Mon, 06 June 2005 19:02 Go to previous message
Eclipse UserFriend
Originally posted by: tcnesham.email.uophx.edu

As I mentioned, when I bring this up in the VE painter the table object is
actually below a sort of "shadow" of itself. I cannot visually move it
around. I added public PlayersTable(Shell parent, Td td) and run().
Attached are all the files, nothing proprietary.


=======================
/*
* Created on Jun 4, 2005
*
*/
package td;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;


import org.eclipse.swt.widgets.Table;
/**
* @author tcnesham
*
*/
public class PlayersTable extends Composite
{

private Button new_button = null;
private Button delete_button = null;
private Shell sShell;
private Td td;
private Display display;


private Table table = null; //
@jve:decl-index=0:visual-constraint="95,149"
/**
* Custom Constructor
* @param parent
* @param td
*/
public PlayersTable(Shell parent, Td td)
{
super(parent, SWT.PRIMARY_MODAL);
this.td = td;
initialize();
}

/**
* Constructor created by painter
* @param parent
* @param style
*/
public PlayersTable(Composite parent, int style)
{
super(parent, style);
initialize();
}

private void initialize()
{

new_button = new Button(this, SWT.NONE);
delete_button = new Button(this, SWT.NONE);

createTable();

new_button.setBounds(new org.eclipse.swt.graphics.Rectangle(519, 387,
76, 32));
new_button.setText("New");
delete_button.setBounds(new org.eclipse.swt.graphics.Rectangle(601, 387,
76, 32));
delete_button.setText("Delete");
setSize(new org.eclipse.swt.graphics.Point(772, 461));
}

public void run()
{
display = new Display();

sShell.open();
while (!sShell.isDisposed())
{
if (!display.readAndDispatch())
{
display.sleep();
}
}
display.dispose();

}



/**
* This method initializes table
*
*/
private void createTable() {
table = new Table(this, SWT.BORDER);
table.setFont(new
org.eclipse.swt.graphics.Font(org.eclipse.swt.widgets.Displa y.getDefault(),
"Arial", 10, org.eclipse.swt.SWT.NORMAL));
table.setBounds(new org.eclipse.swt.graphics.Rectangle(54,53,572,156));
}
} // @jve:decl-index=0:visual-constraint="65,-170"


--
Timothy C. Nesham
School: tcnesham@email.uophx.edu
Work: tcnesham@cvty.com

"Rich Kulp" <richkulp@us.NO_SPAM.ibm.com> wrote in message
news:d8215u$8p1$1@news.eclipse.org...
> Could you please paste a copy of the code that got generated? That would
> help to see what you were trying to do.



  • Attachment: td.zip
    (Size: 22.92KB, Downloaded 108 times)
Re: Painting an SWT Table [message #607894 is a reply to message #93055] Mon, 06 June 2005 21:00 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

You found a very interesting bug in 1.0.2. It works ok in our latest
development drivers of VE 1.1.

The fix is simple, get rid of sShell. It gets confused with the shell.

You really don't want the shell there anyway because the run shouldn't
be done on an instance of the class.

--
Thanks,
Rich Kulp
Re: Painting an SWT Table [message #607896 is a reply to message #93086] Mon, 06 June 2005 21:35 Go to previous message
Eclipse UserFriend
Originally posted by: tcnesham.email.uophx.edu

Great! That did the trick. I should have guessed I could simply call
getShell() without declaring a variable.

--
Timothy C. Nesham
School: tcnesham@email.uophx.edu
Work: tcnesham@cvty.com

"Rich Kulp" <richkulp@us.NO_SPAM.ibm.com> wrote in message
news:d82dhq$pdp$1@news.eclipse.org...
> You found a very interesting bug in 1.0.2. It works ok in our latest
> development drivers of VE 1.1.
>
> The fix is simple, get rid of sShell. It gets confused with the shell.
>
> You really don't want the shell there anyway because the run shouldn't
> be done on an instance of the class.
>
> --
> Thanks,
> Rich Kulp
Previous Topic:Painting an SWT Table
Next Topic:Capturing Images
Goto Forum:
  


Current Time: Tue Sep 24 17:48:37 GMT 2024

Powered by FUDForum. Page generated in 0.04085 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top