Search in sources :

Example 6 with InterfaceType

use of net.sourceforge.usbdm.constants.UsbdmSharedConstants.InterfaceType in project usbdm-eclipse-plugins by podonoghue.

the class UsbdmDebuggerPanel method populateInterfaceTypes.

/**
 * Add interface names to Interface combo
 *
 * @param interfaceTypeToSelect
 *           Used as initial selection
 */
private void populateInterfaceTypes(InterfaceType interfaceTypeToSelect) {
    // System.err.println("populateInterfaceTypes() "+ interfaceTypeToSelect);
    int index = 0;
    if (fComboInterfaceTypeListener != null) {
        fComboInterfaceType.removeModifyListener(fComboInterfaceTypeListener);
    }
    fComboInterfaceType.removeAll();
    for (InterfaceType interfaceType : InterfaceType.values()) {
        fComboInterfaceType.add(interfaceType.toString());
        fInterfaceTypes[index++] = interfaceType;
    }
    if (fComboInterfaceTypeListener == null) {
        fComboInterfaceTypeListener = new ModifyListener() {

            @Override
            public void modifyText(ModifyEvent e) {
                // System.err.println("populateInterfaceTypes().modifyText()");
                String value = fComboInterfaceType.getText();
                if (!value.equals(fComboInterfaceType.getData())) {
                    fComboInterfaceType.setData(value);
                    if (value.length() > 0) {
                        fSuspendUpdate++;
                        try {
                            populateGdbServerControls();
                        } catch (Exception e1) {
                            e1.printStackTrace();
                        }
                        String deviceName = fGdbServerParameters.getDeviceName();
                        fTextTargetDeviceName.setText(deviceName);
                        populateBuildTools();
                        fSuspendUpdate--;
                        doUpdate();
                    }
                }
            }
        };
    }
    // Add watchers for user data entry
    fComboInterfaceType.addModifyListener(fComboInterfaceTypeListener);
    if (interfaceTypeToSelect != null) {
        // Select the required interface
        fComboInterfaceType.setText(interfaceTypeToSelect.toString());
    }
}
Also used : InterfaceType(net.sourceforge.usbdm.constants.UsbdmSharedConstants.InterfaceType) ModifyEvent(org.eclipse.swt.events.ModifyEvent) ModifyListener(org.eclipse.swt.events.ModifyListener) CoreException(org.eclipse.core.runtime.CoreException)

Aggregations

InterfaceType (net.sourceforge.usbdm.constants.UsbdmSharedConstants.InterfaceType)6 CoreException (org.eclipse.core.runtime.CoreException)3 ToolInformationData (net.sourceforge.usbdm.constants.ToolInformationData)1 Device (net.sourceforge.usbdm.deviceDatabase.Device)1 DeviceSelector (net.sourceforge.usbdm.deviceDatabase.ui.DeviceSelector)1 UsbdmException (net.sourceforge.usbdm.jni.UsbdmException)1 CoreModel (org.eclipse.cdt.core.model.CoreModel)1 ICProjectDescription (org.eclipse.cdt.core.settings.model.ICProjectDescription)1 CConfigurationData (org.eclipse.cdt.core.settings.model.extension.CConfigurationData)1 IConfiguration (org.eclipse.cdt.managedbuilder.core.IConfiguration)1 IProjectType (org.eclipse.cdt.managedbuilder.core.IProjectType)1 Configuration (org.eclipse.cdt.managedbuilder.internal.core.Configuration)1 ManagedBuildInfo (org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo)1 ManagedProject (org.eclipse.cdt.managedbuilder.internal.core.ManagedProject)1 IProject (org.eclipse.core.resources.IProject)1 SubMonitor (org.eclipse.core.runtime.SubMonitor)1 ModifyEvent (org.eclipse.swt.events.ModifyEvent)1 ModifyListener (org.eclipse.swt.events.ModifyListener)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1 SelectionListener (org.eclipse.swt.events.SelectionListener)1