Combo Box Refresh [message #718762] |
Thu, 25 August 2011 09:20 |
georgsteinbacher Messages: 2 Registered: August 2011 |
Junior Member |
|
|
Hey,
I am working on a Plugin which reads Data out of a XML File, then adds this Data to different Combo Boxes in the Eclipse Toolbar.
I have a Button which enables the user to select the Input XML File for the Combo Boxes and here is my Problem.
When i run my Plugin the first time all works fine BUT when i select a new Input File the Data inside the Combo Boxes will not get refreshed and just shows the old Data.
Would be cool if someone give me a Idea for refreshing my Combo Boxes (:
here the Code of one of my Combo Boxes:
import java.io.IOException;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.menus.WorkbenchWindowControlContribution;
import org.jdom.JDOMException;
import anewtest.actions.OpenFile;
public class Drop_down_menu1 extends WorkbenchWindowControlContribution
{
....
@Override
protected Control createControl(Composite parent)
{
OpenFile open = new OpenFile();
Open Ppfad = new Open();
global.DerPfad = Ppfad.GetPfad(); // The Input File
try {
int temp = open.GetDDM1Laenge();
open.Eintraege = open.GetDDM1(temp);
open.laenge = open.GetDDM1Laenge();
} catch (JDOMException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
Combo combo = new Combo(parent, SWT.READ_ONLY);
combo.setItems (open.Eintraege);
combo.setText (open.Eintraege[0]);
combo.setVisibleItemCount(open.laenge);
combo.setToolTipText(ToolTipText);
temp = combo.getSelectionIndex();
return combo;
}
}
so one of my Problems is that i don´t know what "Composite parent" is and where i get it from, since i found the code for the ComboBox in a other forum and just changed it for my Projekt
[Updated on: Thu, 25 August 2011 13:31] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.04469 seconds