Skip to main content



      Home
Home » Eclipse Projects » GEF » how to create a pop window in gef ?
how to create a pop window in gef ? [message #99415] Mon, 13 October 2003 11:34 Go to next message
Eclipse UserFriend
Originally posted by: nemo_fc.sina.com

Is it possible to create a pop sub-window in gef? For example,I click
mouse' right button in editor,chose the context "setting" of right button
menu,then show a window which could be fill with settinng information.How
could I implement the pop window?How could I get the parent shell or
parent window for this pop window?
Re: how to create a pop window in gef ? [message #99601 is a reply to message #99415] Tue, 14 October 2003 03:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nemo_fc.sina.com

I have implemented that pop sub-window but how can I modify the model I
selected by fill some information in this dialog(pop sub-window)?

my right button action code:

public class nemoPropertyAction extends SelectionAction {
public static final String
PROPERTY = "Property";
public nemoPropertyAction(IWorkbenchPart part) {
super(part);
System.out.println("call getId " +getId());
this.setText("Property");
this.setToolTipText("set property");
}

protected boolean calculateEnabled() {

return canPerformAction();
}

private boolean canPerformAction() {

if(getSelectedObjects().isEmpty())
return false;
List parts = getSelectedObjects();
for (int i=0; i<parts.size(); i++){
Object o = parts.get(i);
if (!(o instanceof EditPart))
return false;
EditPart part = (EditPart)o;
if (!(part.getModel() instanceof HelloNodeModel))
return false;
}
return true;
}

public String getId() {
return this.PROPERTY;
}

public void run() {
Shell shell = new Shell();
nemoPropertyDialog npd = new nemoPropertyDialog(shell);
npd.open();
}
}


this my dialog code:

public class nemoPropertyDialog extends Dialog{
private Button tile, fitPage, fitWidth, fitHeight;
private Text input;
protected nemoPropertyDialog(Shell parentShell) {
super(parentShell);
}

protected void cancelPressed() {
super.cancelPressed();
close();
}

protected void configureShell(Shell newShell) {
super.configureShell(newShell);
}

protected Control createDialogArea(Composite parent) {
Composite composite = (Composite)super.createDialogArea(parent);

tile = new Button(composite, SWT.RADIO);
tile.setText("Tile");
tile.setSelection(true);

new Label(composite, SWT.NONE).setText("ID:");
input = new Text(composite, SWT.SINGLE | SWT.BORDER);
input.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
return composite;
}

protected void okPressed() {
super.okPressed();
close();
}
}
Re: how to create a pop window in gef ? [message #99847 is a reply to message #99601] Wed, 15 October 2003 06:00 Go to previous message
Eclipse UserFriend
Originally posted by: nemo_fc.sina.com

I find the way to implement it .thanks
"nemo" <nemo_fc@sina.com> д
Previous Topic:How can create right button menu like logic example?
Next Topic:Label left alignment
Goto Forum:
  


Current Time: Fri May 09 17:24:18 EDT 2025

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

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

Back to the top