mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
Use jdk 5 for-each loop
Replace simple uses of Iterator with a corresponding for-loop. Also add missing braces on loops as necessary. Change-Id: I7e158278fd2042b527f76b100815cf385b79ea20 Signed-off-by: chammer <carsten.hammer@t-online.de>
This commit is contained in:
parent
3ba744c9c8
commit
6001af3797
11 changed files with 16 additions and 31 deletions
|
@ -8,11 +8,10 @@
|
||||||
|
|
||||||
SPDX-License-Identifier: EPL-2.0
|
SPDX-License-Identifier: EPL-2.0
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<feature
|
<feature
|
||||||
id="org.eclipse.tm.terminal.feature"
|
id="org.eclipse.tm.terminal.feature"
|
||||||
label="%featureName"
|
label="%featureName"
|
||||||
version="4.5.100.qualifier"
|
version="4.5.200.qualifier"
|
||||||
provider-name="%providerName"
|
provider-name="%providerName"
|
||||||
plugin="org.eclipse.tm.terminal.view.core"
|
plugin="org.eclipse.tm.terminal.view.core"
|
||||||
license-feature="org.eclipse.license"
|
license-feature="org.eclipse.license"
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>org.eclipse.tm.terminal.feature</artifactId>
|
<artifactId>org.eclipse.tm.terminal.feature</artifactId>
|
||||||
|
<version>4.5.200-SNAPSHOT</version>
|
||||||
<packaging>eclipse-feature</packaging>
|
<packaging>eclipse-feature</packaging>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|
|
@ -8,11 +8,10 @@
|
||||||
|
|
||||||
SPDX-License-Identifier: EPL-2.0
|
SPDX-License-Identifier: EPL-2.0
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<feature
|
<feature
|
||||||
id="org.eclipse.tm.terminal.view.feature"
|
id="org.eclipse.tm.terminal.view.feature"
|
||||||
label="%featureName"
|
label="%featureName"
|
||||||
version="4.5.100.qualifier"
|
version="4.5.200.qualifier"
|
||||||
provider-name="%providerName"
|
provider-name="%providerName"
|
||||||
plugin="org.eclipse.tm.terminal.view.core"
|
plugin="org.eclipse.tm.terminal.view.core"
|
||||||
license-feature="org.eclipse.license"
|
license-feature="org.eclipse.license"
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>org.eclipse.tm.terminal.view.feature</artifactId>
|
<artifactId>org.eclipse.tm.terminal.view.feature</artifactId>
|
||||||
|
<version>4.5.200-SNAPSHOT</version>
|
||||||
<packaging>eclipse-feature</packaging>
|
<packaging>eclipse-feature</packaging>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %pluginName
|
Bundle-Name: %pluginName
|
||||||
Bundle-SymbolicName: org.eclipse.tm.terminal.view.ui;singleton:=true
|
Bundle-SymbolicName: org.eclipse.tm.terminal.view.ui;singleton:=true
|
||||||
Bundle-Version: 4.5.102.qualifier
|
Bundle-Version: 4.5.200.qualifier
|
||||||
Bundle-Activator: org.eclipse.tm.terminal.view.ui.activator.UIPlugin
|
Bundle-Activator: org.eclipse.tm.terminal.view.ui.activator.UIPlugin
|
||||||
Bundle-Vendor: %providerName
|
Bundle-Vendor: %providerName
|
||||||
Require-Bundle: org.eclipse.core.expressions;bundle-version="3.4.400",
|
Require-Bundle: org.eclipse.core.expressions;bundle-version="3.4.400",
|
||||||
|
|
|
@ -22,6 +22,6 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>org.eclipse.tm.terminal.view.ui</artifactId>
|
<artifactId>org.eclipse.tm.terminal.view.ui</artifactId>
|
||||||
<version>4.5.102-SNAPSHOT</version>
|
<version>4.5.200-SNAPSHOT</version>
|
||||||
<packaging>eclipse-plugin</packaging>
|
<packaging>eclipse-plugin</packaging>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -237,8 +237,8 @@ public class ConfigurationPanelControl implements IConfigurationPanelContainer,
|
||||||
Assert.isNotNull(parent);
|
Assert.isNotNull(parent);
|
||||||
|
|
||||||
if (configurationPanelKeys != null) {
|
if (configurationPanelKeys != null) {
|
||||||
for (int i = 0; i < configurationPanelKeys.length; i++) {
|
for (String configurationPanelKey : configurationPanelKeys) {
|
||||||
IConfigurationPanel configPanel = getConfigurationPanel(configurationPanelKeys[i]);
|
IConfigurationPanel configPanel = getConfigurationPanel(configurationPanelKey);
|
||||||
Assert.isNotNull(configPanel);
|
Assert.isNotNull(configPanel);
|
||||||
configPanel.setupPanel(parent);
|
configPanel.setupPanel(parent);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,9 +47,7 @@ public class NoteCompositeHelper {
|
||||||
@Override
|
@Override
|
||||||
public void setEnabled(boolean enabled) {
|
public void setEnabled(boolean enabled) {
|
||||||
super.setEnabled(enabled);
|
super.setEnabled(enabled);
|
||||||
Control[] childs = getChildren();
|
for (Control child : getChildren()) {
|
||||||
for (int iChild = 0; iChild < childs.length; iChild++) {
|
|
||||||
Control child = childs[iChild];
|
|
||||||
child.setEnabled(enabled);
|
child.setEnabled(enabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -234,11 +234,7 @@ public class ConsoleManager {
|
||||||
private IViewPart getTerminalsViewWithSecondaryId(String id, String secondaryId, boolean restore) {
|
private IViewPart getTerminalsViewWithSecondaryId(String id, String secondaryId, boolean restore) {
|
||||||
Assert.isNotNull(id);
|
Assert.isNotNull(id);
|
||||||
|
|
||||||
IWorkbenchPage page = getActiveWorkbenchPage();
|
for (IViewReference ref : getActiveWorkbenchPage().getViewReferences()) {
|
||||||
|
|
||||||
IViewReference[] refs = page.getViewReferences();
|
|
||||||
for (int i = 0; i < refs.length; i++) {
|
|
||||||
IViewReference ref = refs[i];
|
|
||||||
if (ref.getId().equals(id)) {
|
if (ref.getId().equals(id)) {
|
||||||
if (ANY_SECONDARY_ID.equals(secondaryId)
|
if (ANY_SECONDARY_ID.equals(secondaryId)
|
||||||
|| secondaryId == null && ref.getSecondaryId() == null
|
|| secondaryId == null && ref.getSecondaryId() == null
|
||||||
|
@ -289,13 +285,10 @@ public class ConsoleManager {
|
||||||
public String getNextTerminalSecondaryId(String id) {
|
public String getNextTerminalSecondaryId(String id) {
|
||||||
Assert.isNotNull(id);
|
Assert.isNotNull(id);
|
||||||
|
|
||||||
IWorkbenchPage page = getActiveWorkbenchPage();
|
|
||||||
Map<String, IViewReference> terminalViews = new HashMap<String, IViewReference>();
|
Map<String, IViewReference> terminalViews = new HashMap<String, IViewReference>();
|
||||||
|
|
||||||
int maxNumber = 0;
|
int maxNumber = 0;
|
||||||
IViewReference[] refs = page.getViewReferences();
|
for (IViewReference ref : getActiveWorkbenchPage().getViewReferences()) {
|
||||||
for (int i = 0; i < refs.length; i++) {
|
|
||||||
IViewReference ref = refs[i];
|
|
||||||
if (ref.getId().equals(id)) {
|
if (ref.getId().equals(id)) {
|
||||||
if (ref.getSecondaryId() != null) {
|
if (ref.getSecondaryId() != null) {
|
||||||
terminalViews.put(ref.getSecondaryId(), ref);
|
terminalViews.put(ref.getSecondaryId(), ref);
|
||||||
|
@ -533,9 +526,7 @@ public class ConsoleManager {
|
||||||
|
|
||||||
IWorkbenchPage page = getActiveWorkbenchPage();
|
IWorkbenchPage page = getActiveWorkbenchPage();
|
||||||
if (page != null) {
|
if (page != null) {
|
||||||
IViewReference[] refs = page.getViewReferences();
|
for (IViewReference ref : page.getViewReferences()) {
|
||||||
for (int i = 0; i < refs.length; i++) {
|
|
||||||
IViewReference ref = refs[i];
|
|
||||||
IViewPart part = ref != null ? ref.getView(false) : null;
|
IViewPart part = ref != null ? ref.getView(false) : null;
|
||||||
if (part instanceof ITerminalsView) {
|
if (part instanceof ITerminalsView) {
|
||||||
CTabFolder tabFolder = (CTabFolder) part.getAdapter(CTabFolder.class);
|
CTabFolder tabFolder = (CTabFolder) part.getAdapter(CTabFolder.class);
|
||||||
|
@ -576,8 +567,7 @@ public class ConsoleManager {
|
||||||
IWorkbenchPage page = getActiveWorkbenchPage();
|
IWorkbenchPage page = getActiveWorkbenchPage();
|
||||||
if (page != null) {
|
if (page != null) {
|
||||||
IViewReference[] refs = page.getViewReferences();
|
IViewReference[] refs = page.getViewReferences();
|
||||||
for (int i = 0; i < refs.length; i++) {
|
for (IViewReference ref : refs) {
|
||||||
IViewReference ref = refs[i];
|
|
||||||
if (ref.getId().equals(id)) {
|
if (ref.getId().equals(id)) {
|
||||||
IViewPart part = ref.getView(true);
|
IViewPart part = ref.getView(true);
|
||||||
if (part instanceof ITerminalsView) {
|
if (part instanceof ITerminalsView) {
|
||||||
|
|
|
@ -132,8 +132,7 @@ public abstract class AbstractExtendedConfigurationPanel extends AbstractConfigu
|
||||||
|
|
||||||
String[] hosts = settings.getArray(HOSTS_TAG);
|
String[] hosts = settings.getArray(HOSTS_TAG);
|
||||||
if (hosts != null) {
|
if (hosts != null) {
|
||||||
for (int i = 0; i < hosts.length; i++) {
|
for (String hostEntry : hosts) {
|
||||||
String hostEntry = hosts[i];
|
|
||||||
String[] hostString = hostEntry.split("\\|");//$NON-NLS-1$
|
String[] hostString = hostEntry.split("\\|");//$NON-NLS-1$
|
||||||
String hostName = hostString[0];
|
String hostName = hostString[0];
|
||||||
if (hostString.length == 2) {
|
if (hostString.length == 2) {
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class TerminalService implements ITerminalService {
|
||||||
/**
|
/**
|
||||||
* The registered terminal tab dispose listeners.
|
* The registered terminal tab dispose listeners.
|
||||||
*/
|
*/
|
||||||
private final ListenerList terminalTabListeners = new ListenerList();
|
private final ListenerList<ITerminalTabListener> terminalTabListeners = new ListenerList<ITerminalTabListener>();
|
||||||
|
|
||||||
// Flag to remember if the terminal view has been restored or not.
|
// Flag to remember if the terminal view has been restored or not.
|
||||||
private boolean fRestoringView;
|
private boolean fRestoringView;
|
||||||
|
@ -120,10 +120,8 @@ public class TerminalService implements ITerminalService {
|
||||||
if (terminalTabListeners.isEmpty()) return;
|
if (terminalTabListeners.isEmpty()) return;
|
||||||
|
|
||||||
// Get the list or currently registered listeners
|
// Get the list or currently registered listeners
|
||||||
Object[] l = terminalTabListeners.getListeners();
|
|
||||||
// Loop the registered terminal tab listeners and invoke the proper method
|
// Loop the registered terminal tab listeners and invoke the proper method
|
||||||
for (int i = 0; i < l.length; i++) {
|
for (final ITerminalTabListener listener : terminalTabListeners) {
|
||||||
final ITerminalTabListener listener = (ITerminalTabListener) l[i];
|
|
||||||
ISafeRunnable job = new ISafeRunnable() {
|
ISafeRunnable job = new ISafeRunnable() {
|
||||||
@Override
|
@Override
|
||||||
public void handleException(Throwable exception) {
|
public void handleException(Throwable exception) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue