mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
autotools: Adapt to generified ListenerList.
Neon generified ListenerList so cleanup here too. Change-Id: I569ddf79d4cc0e805da5083867f3c403aa6d79b9 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
This commit is contained in:
parent
b91b69775f
commit
d81d00ec47
4 changed files with 16 additions and 18 deletions
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006, 2015 Red Hat, Inc.
|
||||
* Copyright (c) 2006, 2016 Red Hat, Inc. 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
|
||||
|
@ -111,7 +111,7 @@ public class AutoconfEditor extends TextEditor implements IAutotoolsEditor, IPro
|
|||
/**
|
||||
* Reconciling listeners
|
||||
*/
|
||||
private ListenerList fReconcilingListeners= new ListenerList(ListenerList.IDENTITY);
|
||||
private ListenerList<IReconcilingParticipant> fReconcilingListeners = new ListenerList<>(ListenerList.IDENTITY);
|
||||
|
||||
|
||||
public AutoconfEditor() {
|
||||
|
@ -600,9 +600,8 @@ public class AutoconfEditor extends TextEditor implements IAutotoolsEditor, IPro
|
|||
*/
|
||||
public void reconciled() {
|
||||
// Notify listeners
|
||||
Object[] listeners = fReconcilingListeners.getListeners();
|
||||
for (int i = 0, length= listeners.length; i < length; ++i) {
|
||||
((IReconcilingParticipant)listeners[i]).reconciled();
|
||||
for (IReconcilingParticipant listener : fReconcilingListeners) {
|
||||
listener.reconciled();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2015 QNX Software Systems and others.
|
||||
* Copyright (c) 2000, 2016 QNX Software Systems 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
|
||||
|
@ -68,7 +68,7 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe
|
|||
* Reconciling listeners.
|
||||
* @since 3.0
|
||||
*/
|
||||
private ListenerList fReconcilingListeners= new ListenerList(ListenerList.IDENTITY);
|
||||
private ListenerList<IReconcilingParticipant> fReconcilingListeners = new ListenerList<>(ListenerList.IDENTITY);
|
||||
|
||||
|
||||
MakefileSourceConfiguration getMakefileSourceConfiguration() {
|
||||
|
@ -331,9 +331,8 @@ public class MakefileEditor extends TextEditor implements ISelectionChangedListe
|
|||
@Override
|
||||
public void reconciled() {
|
||||
// Notify listeners
|
||||
Object[] listeners = fReconcilingListeners.getListeners();
|
||||
for (int i = 0, length= listeners.length; i < length; ++i) {
|
||||
((IReconcilingParticipant)listeners[i]).reconciled();
|
||||
for (IReconcilingParticipant listener: fReconcilingListeners) {
|
||||
listener.reconciled();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2009, 2015 Red Hat Inc.
|
||||
* Copyright (c) 2009, 2016 Red Hat Inc. 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
|
||||
|
@ -29,7 +29,7 @@ public class AutotoolsConfigurePrefStore implements IPreferenceStore {
|
|||
private static AutotoolsConfigurePrefStore instance = null;
|
||||
private ToolListElement selectedElement;
|
||||
private IAConfiguration cfg;
|
||||
private ListenerList listenerList = new ListenerList();
|
||||
private ListenerList<IPropertyChangeListener> listenerList = new ListenerList<>();
|
||||
private boolean isdirty;
|
||||
|
||||
private AutotoolsConfigurePrefStore() {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007, 2015 Red Hat Inc.
|
||||
* Copyright (c) 2007, 2016 Red Hat Inc. 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
|
||||
|
@ -19,7 +19,7 @@ import org.eclipse.core.runtime.ListenerList;
|
|||
public class AutotoolsPropertyManager implements IPropertyChangeManager {
|
||||
|
||||
private static volatile AutotoolsPropertyManager fInstance;
|
||||
private Map<IProject, ListenerList> projectList;
|
||||
private Map<IProject, ListenerList<IProjectPropertyListener>> projectList;
|
||||
|
||||
private AutotoolsPropertyManager() {
|
||||
projectList = new HashMap<>();
|
||||
|
@ -34,9 +34,9 @@ public class AutotoolsPropertyManager implements IPropertyChangeManager {
|
|||
@Override
|
||||
public synchronized void addProjectPropertyListener(IProject project,
|
||||
IProjectPropertyListener listener) {
|
||||
ListenerList list = projectList.get(project);
|
||||
ListenerList<IProjectPropertyListener> list = projectList.get(project);
|
||||
if (list == null) {
|
||||
list = new ListenerList();
|
||||
list = new ListenerList<>();
|
||||
projectList.put(project, list);
|
||||
}
|
||||
list.add(listener);
|
||||
|
@ -44,7 +44,7 @@ public class AutotoolsPropertyManager implements IPropertyChangeManager {
|
|||
|
||||
@Override
|
||||
public synchronized void notifyPropertyListeners(IProject project, String property) {
|
||||
ListenerList list = projectList.get(project);
|
||||
ListenerList<IProjectPropertyListener> list = projectList.get(project);
|
||||
if (list != null) {
|
||||
Object[] listeners = list.getListeners();
|
||||
for (int i = 0; i < listeners.length; ++i) {
|
||||
|
@ -56,7 +56,7 @@ public class AutotoolsPropertyManager implements IPropertyChangeManager {
|
|||
@Override
|
||||
public synchronized void removeProjectPropertyListener(IProject project,
|
||||
IProjectPropertyListener listener) {
|
||||
ListenerList list = projectList.get(project);
|
||||
ListenerList<IProjectPropertyListener> list = projectList.get(project);
|
||||
if (list != null)
|
||||
list.remove(listener);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue