Eclipse and GWT desing mode - java

I am Working with GWT and eclipse. I am facing a problem . The design mode of eclipse is not working. I am using the eclipse 3.7 . Where is the problem?

One way to see design view is extending the view part. you can try this one.
public class test extends ViewPart {
public test() {
// TODO Auto-generated constructor stub
}
#Override
public void createPartControl(Composite parent) {
// TODO Auto-generated method stub
}
#Override
public void setFocus() {
}
}

You need to right click the file you want to open, then click open with --> GWT Designer.

Make sure your resource exclusion filters are not too strict.
If you are using Maven, the issue is explained here.

Related

My first applet shows nothing

I am trying to run this applet code below.But When I run it .I just get an empty Applet screen that says applet started.
public class Ass extends JApplet{
double sum;
public void init(){
double D1=Double.parseDouble(JOptionPane.showInputDialog("firstvAL"));
double D2=Double.parseDouble(JOptionPane.showInputDialog("secondvAL"));
sum=D1+D2;
}
#Override
public void print(Graphics g) {
// TODO Auto-generated method stub
super.print(g);
g.drawString("Sum is"+sum,44,44);
}
}
And I want to ask one more thing.I have removed eclips ide and downloaded Enterprice edition .And noticed these two section .Why is that? did I make a mistake while removing eclipse folder
I think you should be using paint ( ) instead of print ( ) .

Reloading Eclipse view

I have a plugin with a view that creates a tableviewer based on different files found in the selected project (the workspace has more than one project loaded). My problem is that when I try to reload the view the information remains the same as on the first run after Eclipse started.
What should I do in order to reload the content provider everytime I reload the view ?
To be told about which part is active you need to use IPartListener2. Make your ViewPart implement IPartListener2.
Set up the listener in the createPartControl:
#Override
public void createPartControl(final Composite parent)
{
....
getSite().getWorkbenchWindow().getPartService().addPartListener(this);
}
Remove the listener in dispose:
#Override
public void dispose()
{
super.dispose();
...
getSite().getWorkbenchWindow().getPartService().removePartListener(this);
}
You will have to implement the various methods of IPartListener, most of these don't need to do anything, the partVisible method is called when your view (or any other part) is shown:
#Override
public void partVisible(final IWorkbenchPartReference ref)
{
if (ref.getId().equals("your view id"))
{
// Your view has become visible ... add code here to update the table
}
}
This is how my partVisible looks:
public void partVisible(IWorkbenchPartReference partRef) {
// TODO Auto-generated method stub
if (partRef.getId().equals("view id taken from extensions"))
{
getWorkspacePath();
viewer.remove(TableContent.INSTANCE.getRow());
viewer.setInput(TableContent.INSTANCE.updateContentProvider());
viewer.refresh();
}
}
The path is updated (i've displayed the path in the view) but the content of the table isn't....updateContentProvider contains the call of the functions that need to parse some files in the selected project....

JavaHL.Unable to commit with my java application

I want to control my Subversion environment (Sliksvn 1.8.10) with a small Java programm on a Windows 7 64 bit machine. I need to use JavaHL (1.8.x) not SVNKIt. I have implemented a funktion to checkout a repository, add files to a work copy and commit files to repository. The checkout and the add function works fine so far. The problem ist now, that the commit-funktion don't work correctly.
public void commit()
{
Set<String> paths = new HashSet<String>();
paths.add( "C:\\Users\\XXX\\Documents\\SVNTEST\\Test3" );
Depth dep = Depth.infinity;
);
CommitMessageCallback handler = new CommitMessageCallback()
{
#Override
public String getLogMessage(Set<CommitItem> arg0) {
// TODO Auto-generated method stub
System.out.println(arg0.size());
return null;
}
};
CommitCallback callback = new CommitCallback()
{
#Override
public void commitInfo(CommitInfo arg0) {
// TODO Auto-generated method stub
System.out.println(arg0.getAuthor());
}
};
try
{
client.commit( paths, dep, true, false, null, null, handler, callback );
}
catch( ClientException e )
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
When i process the commit function, then i get from the CommitMessageCallback function the amount of the commit items. This works still. My problem is now, that don't receive any CommitInfo from the CommitCallback function. I think maybe, the process breaks up in der subversion environment and my function get no result. After the process, the commit Items are still in svn status "Item is scheduled for Addition".
I work on this problem since a few days with different version of the JavaHL.jar api, but it was not successful. The big problem is also, that i receive no error message and i dont know what is wrong in code.
Have anybody a idea what is wrong in my commit function ?
Perhaps is the libsvnjavahl-1.dll file not compatible with certain JavaHL Api's ?
Thank you very much
Best regards Simon
Okay, i solved the problem now. The easy solution was to use the org.tigris.subversion instead of the org.apache.subversion library classes. But the question is, why exist two different version from the JavaHL library ?

Implement postWindowClose() in RCP application

Hi RCP developers,
I want to iplement postWindowClose() in my ECLIPSE RCP application.
Before coding this method, I just did a small test to see if when I close my application, the method is called, so I did that :
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
public class MainWindowControl extends WorkbenchWindowAdvisor{
public MainWindowControl(IWorkbenchWindowConfigurer configurer) {
super(configurer);
// TODO Auto-generated constructor stub
}
#Override
public void postWindowClose() {
// TODO Auto-generated method stub
super.postWindowClose();
System.out.println("close");
}
}
I am expecting to see : close in ECLIPSE console, but it's still blank after closing the application.
All the required plugins are added , and I have no error while launching or closing the application.
So, AM I missing something ?
The reasons why to implemets this method are :
Msg box : Are you sure you want to close the application
Kill all the running threads, my application upload files and even when I close the application running uploads continues. I want to abort them when closing the application.
Edit :
My life cycle class :
package upload.center.util;
import org.eclipse.e4.ui.workbench.lifecycle.PostContextCreate;
import org.eclipse.e4.ui.workbench.lifecycle.PreSave;
public class WindowLifeCycle {
#PostContextCreate
public void postContextCreate()
{
// TODO start up code here
System.out.println("open");
}
#PreSave
public void preSave()
{
// TODO add shutdown code here
System.out.println("close");
}
}
My plugin.xml :
<product ....
<property
name="windowLifeCycle"
value="bundleclass://UploadCenter.Source/upload.center.util.WindowLifeCycle">
</property>
...</product>
I hope that I am clear enough.
Ismail
For a pure Eclipse 4 (e4) application the workbench window advisor (and the other advisors) are not used. You use the #PreSave method of a life cycle class to run code during shutdown.
public class LifeCycle
{
#PostContextCreate
public void postContextCreate()
{
// TODO start up code here
}
#PreSave
public void preSave()
{
// TODO add shutdown code here
}
}
declare the life cycle class in the product definition in the plugin.xml:
<extension
id="product"
point="org.eclipse.core.runtime.products">
<product
name="%product.name"
application="org.eclipse.e4.ui.workbench.swt.E4Application">
<property
name="lifeCycleURI"
value="bundleclass://plugin-id/package.LifeCycle">
</property>
.... more properties ...
For more details see here

#Override annotation error in Eclipse, why can't I resolve this?

I've already tried this question...
However, this seems to have been resolved in the newer version of Eclipse, as it already was set to 1.6 (I've installed JRE 6 too). But Eclipse still throws an error that I can't set to ignore, apparently.
Here's a part of my code (copied from a learning Java for Android website, so it should work...).
private class RadioGroupInfo implements OnCheckedChangeListener {
private RadioButton mLastChecked;
private String mNewSelectionMessageTemplate;
private String mChangedSelectionMessageTemplate;
public RadioGroupInfo() {
mNewSelectionMessageTemplate = getString(R.string.new_selection_message_template);
mChangedSelectionMessageTemplate = getString(R.string.changed_selection_message_template);
}
#Override
public void onCheckedChanged(RadioGroup group, int CheckedId) {
// TODO Auto-generated method stub
}
}
Throws this error:
The method onCheckedChanged(RadioGroup, int) of type ButtonActivity.RadioGroupInfo must override or implement a supertype method
Check your imports. Are you importing OnCheckedChangeListener from somewhere other than RadioGroup.OnCheckedChangeListener?

Categories