diff options
author | Marc-Andre Laperle | 2011-06-25 19:00:02 +0000 |
---|---|---|
committer | Marc-Andre Laperle | 2011-06-25 19:00:02 +0000 |
commit | ab8f68cc5b25f9fcad5f7d2bed94f3eab4fc9ff1 (patch) | |
tree | d07fca980c138ec3ccc1d3953c7cf8778358a6db /debug/org.eclipse.cdt.debug.ui | |
parent | d34a4195d5bb8b650d847531154a8ba20c46417a (diff) | |
download | org.eclipse.cdt-ab8f68cc5b25f9fcad5f7d2bed94f3eab4fc9ff1.tar.gz org.eclipse.cdt-ab8f68cc5b25f9fcad5f7d2bed94f3eab4fc9ff1.tar.xz org.eclipse.cdt-ab8f68cc5b25f9fcad5f7d2bed94f3eab4fc9ff1.zip |
Bug 335402 - Breakpoint Sound Action fails to change wav file
Fixed hang on Linux gtk
Diffstat (limited to 'debug/org.eclipse.cdt.debug.ui')
2 files changed, 23 insertions, 14 deletions
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpointactions/SoundActionComposite.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpointactions/SoundActionComposite.java index 9792bddbbb2..56f8faed244 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpointactions/SoundActionComposite.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpointactions/SoundActionComposite.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2007 Nokia and others.
+ * Copyright (c) 2007, 2011 Nokia and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -65,7 +65,16 @@ public class SoundActionComposite extends Composite { comboModifyListener = new ModifyListener() {
public void modifyText(ModifyEvent e) {
if (combo_1.getText().length() > 0) {
- setSoundFile(combo_1.getText());
+ String filePath = combo_1.getText();
+ File soundFile = new File(filePath);
+ if (soundFile.exists()) {
+ soundFilePathLabel.setText(filePath);
+ tryItButton.setEnabled(true);
+ selectedSoundFile = soundFile;
+ } else {
+ soundFilePathLabel.setText(Messages.getString("SoundActionComposite.9")); //$NON-NLS-1$
+ tryItButton.setEnabled(false);
+ }
}
}
};
@@ -136,11 +145,11 @@ public class SoundActionComposite extends Composite { private void rebuildRecentSoundsCombo() {
combo_1.removeAll();
- ArrayList sortedSounds = new ArrayList(soundActionPage.getRecentSounds());
+ ArrayList<File> sortedSounds = new ArrayList<File>(soundActionPage.getRecentSounds());
Collections.sort(sortedSounds);
- for (Iterator iter = sortedSounds.iterator(); iter.hasNext();) {
- File element = (File) iter.next();
+ for (Iterator<File> iter = sortedSounds.iterator(); iter.hasNext();) {
+ File element = iter.next();
combo_1.add(element.getAbsolutePath());
}
}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpointactions/SoundActionPage.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpointactions/SoundActionPage.java index c8bab1b750d..7ca9e1734b7 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpointactions/SoundActionPage.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/breakpointactions/SoundActionPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007 Nokia and others. + * Copyright (c) 2007, 2011 Nokia and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -53,7 +53,7 @@ public class SoundActionPage extends PlatformObject implements IBreakpointAction private SoundActionComposite editor = null; private String mediaPath = ""; //$NON-NLS-1$ - private ArrayList recentSounds = new ArrayList(); + private ArrayList<File> recentSounds = new ArrayList<File>(); private SoundAction soundAction; @@ -78,8 +78,8 @@ public class SoundActionPage extends PlatformObject implements IBreakpointAction String soundFilePath = soundFile.getAbsolutePath(); int removeIndex = -1; int fileCount = 0; - for (Iterator iter = recentSounds.iterator(); iter.hasNext() && removeIndex < 0;) { - File element = (File) iter.next(); + for (Iterator<File> iter = recentSounds.iterator(); iter.hasNext() && removeIndex < 0;) { + File element = iter.next(); if (element.getAbsolutePath().equals(soundFilePath)) removeIndex = fileCount; fileCount++; @@ -96,7 +96,7 @@ public class SoundActionPage extends PlatformObject implements IBreakpointAction this.soundAction = (SoundAction) action; loadRecentSounds(); if (soundAction.getSoundFile() == null && recentSounds.size() > 0) - soundAction.setSoundFile((File) recentSounds.get(0)); + soundAction.setSoundFile(recentSounds.get(0)); editor = new SoundActionComposite(composite, style, this); return editor; } @@ -105,7 +105,7 @@ public class SoundActionPage extends PlatformObject implements IBreakpointAction return mediaPath; } - public ArrayList getRecentSounds() { + public ArrayList<File> getRecentSounds() { return recentSounds; } @@ -150,7 +150,7 @@ public class SoundActionPage extends PlatformObject implements IBreakpointAction return; } - recentSounds = new ArrayList(); + recentSounds = new ArrayList<File>(); Element root = null; DocumentBuilder parser; @@ -201,8 +201,8 @@ public class SoundActionPage extends PlatformObject implements IBreakpointAction Element rootElement = doc.createElement("recentSounds"); //$NON-NLS-1$ doc.appendChild(rootElement); - for (Iterator iter = recentSounds.iterator(); iter.hasNext();) { - File soundFile = (File) iter.next(); + for (Iterator<File> iter = recentSounds.iterator(); iter.hasNext();) { + File soundFile = iter.next(); Element element = doc.createElement("soundFileName"); //$NON-NLS-1$ element.setAttribute("name", soundFile.getAbsolutePath()); //$NON-NLS-1$ |