Home » Eclipse Projects » Eclipse 4 » Handler can not search desired class
Handler can not search desired class [message #1257556] |
Wed, 26 February 2014 15:14 |
Muhammad Salman Messages: 3 Registered: February 2014 |
Junior Member |
|
|
hi,
I am a learner I have searched over internet also but could not found or relate answers
I make dialogue class and a class to open it from handler
but when I press Find Class option in handler it doesnt show desired class I have made a Menu and a Command the menu stay dim(not activated means i cant click it)
Here is the code of both classes
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.nebula.widgets.cdatetime.CDT;
import org.eclipse.nebula.widgets.cdatetime.CDateTime;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
;
public class Voggela extends TitleAreaDialog {
public Voggela(Shell parentShell) {
super(parentShell);
}
@Override
public void create() {
super.create();
setTitle(" Weather Data Simulation ");
setMessage("This is a TitleAreaDialog", IMessageProvider.INFORMATION);
}
@Override
protected Control createDialogArea(Composite parent) {
Composite area = (Composite) super.createDialogArea(parent);
Composite container = new Composite(area, SWT.NONE);
container.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout layout = new GridLayout(2, false);
container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
container.setLayout(layout);
createtextComposite(container);
createDateComposite(container);
return area;
}
private void createtextComposite(Composite container){
Composite textComposite = new Composite(container, SWT.CENTER);
GridLayout textGrid = new GridLayout();
textGrid.numColumns = 4;
textComposite.setLayout(textGrid);
new Label(textComposite, SWT.NONE);
Label lblNewLabel = new Label(textComposite, SWT.NONE);
lblNewLabel.setText("File");
new Label(textComposite, SWT.NONE);
Label lblNewLabel_2 = new Label(textComposite, SWT.NONE);
lblNewLabel_2.setText("File Name ABC");
new Label(textComposite, SWT.NONE);
Label lblNewLabel_1 = new Label(textComposite, SWT.NONE);
lblNewLabel_1.setText("Weather");
new Label(textComposite, SWT.NONE);
Label lblNewLabel_3 = new Label(textComposite, SWT.NONE);
GridData gd_lblNewLabel_3 = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
gd_lblNewLabel_3.heightHint = 16;
lblNewLabel_3.setLayoutData(gd_lblNewLabel_3);
lblNewLabel_3.setText("Name Data");
}
private void createDateComposite(Composite container){
Composite dateComposite = new Composite(container, SWT.CENTER);
dateComposite.setLayout(new GridLayout(2, true));
GridData gd_dateComposite = new GridData(SWT.FILL, SWT.FILL, true, true);
gd_dateComposite.heightHint = 77;
dateComposite.setLayoutData(gd_dateComposite);
Label startDate = new Label(dateComposite,SWT.READ_ONLY | SWT.TOP);
startDate.setText("Start Date");
startDate.setLayoutData(new GridData(SWT.CENTER, SWT.BOTTOM, true, true));
Label endDate = new Label(dateComposite,SWT.READ_ONLY | SWT.TOP);
endDate.setText("End Date");
endDate.setLayoutData(new GridData(SWT.CENTER, SWT.BOTTOM, true, true));
final CDateTime cdtStop = new CDateTime(dateComposite, CDT.BORDER | CDT.DROP_DOWN);
cdtStop.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, true, true));
final CDateTime cdtStart = new CDateTime(dateComposite, CDT.BORDER | CDT.DROP_DOWN);
cdtStart.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, true, true));
}
@Override
protected boolean isResizable() {
return true;
}
}
import javax.inject.Named;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.services.IServiceConstants;
import org.eclipse.swt.widgets.Shell;
import de.fraunhofer.iwes.coast.simulator.userstories.dialog.Voggela;
public class OpenHandler {
@Execute
public void execute(
@Named(IServiceConstants.ACTIVE_SHELL) final Shell shell) {
Voggela dialog = new Voggela(shell);
dialog.open();
}
}
|
|
| | |
Goto Forum:
Current Time: Sat Sep 21 03:19:06 GMT 2024
Powered by FUDForum. Page generated in 0.03037 seconds
|