Changes

Jump to: navigation, search

Teams Winter 2011/team2/lab3

1,259 bytes added, 22:59, 22 March 2011
no edit summary
*In order to view and edit our content, we must create a view. Creating a view is very similar to creating a command, except you must add the extension "org.eclipse.ui.views" in our MANIFEST file.
*You should have something that looks akin to this
[[File:UiviewsT2.png]]
*Now that we've included the extension, we should create a new view so we may view and edit our content. We do this by right-clicking our recent addition, scroll to "New", and then click on "view".
*Enter the following information below and once that's completed click on "class*". Clicking on "class*" will allow us to create classes on the fly using the "New Java Class" wizard. Most of the mandatory components for creating a view java class has already been added, so all we have to do is click "Finish"
[[File:Ext4T2.png]]
*Replace code inside "WeatherView.java" with:
<source lang=java>
package ecl.team2.lab3.rcpexample;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.part.ViewPart;
 
public class WeatherView extends ViewPart
{
public static final String ID = "ecl.team2.lab3.rcpexample.WeatherView";
@Override
public void createPartControl(Composite parent)
{
this.setPartName("Weather");
Text text = new Text(parent, SWT.BORDER);
text.setText("Weather content will be displayed here");
}
 
@Override
public void setFocus()
{
// TODO Auto-generated method stub
}
}
</source>
<br/>
==Define and Use Editor==
1
edit

Navigation menu