diff options
64 files changed, 1142 insertions, 822 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/CDOIDMapper.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/CDOIDMapper.java index f588a50058..d31a0a0b11 100644 --- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/CDOIDMapper.java +++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/CDOIDMapper.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo.ui/plugin.xml b/plugins/org.eclipse.emf.cdo.ui/plugin.xml index ee90c7a872..6dfb59dcee 100644 --- a/plugins/org.eclipse.emf.cdo.ui/plugin.xml +++ b/plugins/org.eclipse.emf.cdo.ui/plugin.xml @@ -34,10 +34,10 @@ </view> <view category="org.eclipse.emf.cdo" - class="org.eclipse.emf.cdo.internal.ui.views.CDOSubscriptionsView" + class="org.eclipse.emf.cdo.internal.ui.views.CDOWatchListView" icon="icons/full/view16/watch_list.gif" - id="org.eclipse.emf.cdo.CDOSubscriptionsView" - name="CDO Subscriptions"> + id="org.eclipse.emf.cdo.CDOWatchListView" + name="CDO Watch List"> </view> </extension> diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/RemoveAllContainerItemAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/RemoveAllContainerItemAction.java index 6e649139d8..3815257a68 100644 --- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/RemoveAllContainerItemAction.java +++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/RemoveAllContainerItemAction.java @@ -15,6 +15,8 @@ import org.eclipse.net4j.util.container.IContainer.Modifiable; import org.eclipse.core.runtime.IProgressMonitor; +import java.util.ArrayList; + /** * @author Victor Roldan Betancort */ @@ -29,9 +31,12 @@ public class RemoveAllContainerItemAction<E> extends AbstractContainerAction<E> protected void doRun(IProgressMonitor progressMonitor) throws Exception { Modifiable<E> container = getContainer(); + ArrayList<E> elementsToRemove = new ArrayList<E>(); for (E element : container.getElements()) { - container.removeElement(element); + elementsToRemove.add(element); } + + container.removeAllElements(elementsToRemove); } } diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/RemoveContainerItemAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/RemoveContainerItemAction.java index 7b803fc4e8..d7173c1524 100644 --- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/RemoveContainerItemAction.java +++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/RemoveContainerItemAction.java @@ -63,10 +63,7 @@ public class RemoveContainerItemAction<E> extends AbstractContainerAction<E> targets = null; IContainer.Modifiable<E> container = getContainer(); - for (E target : useTargets) - { - container.removeElement(target); - } + container.removeAllElements(useTargets); } } } diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/dnd/CDOObjectDropAdapter.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/dnd/CDOObjectDropAdapter.java index 5caf543e9c..34232c7f3b 100644 --- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/dnd/CDOObjectDropAdapter.java +++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/dnd/CDOObjectDropAdapter.java @@ -13,6 +13,8 @@ package org.eclipse.emf.cdo.internal.ui.dnd; import org.eclipse.emf.cdo.CDOObject; +import org.eclipse.emf.internal.cdo.util.FSMUtil; + import org.eclipse.net4j.util.container.IContainer; import org.eclipse.net4j.util.ui.dnd.DNDDropAdapter; @@ -22,13 +24,14 @@ import org.eclipse.swt.dnd.DND; import org.eclipse.swt.dnd.Transfer; import org.eclipse.swt.dnd.TransferData; +import java.util.ArrayList; + /** * @author Victor Roldan Betancort */ public class CDOObjectDropAdapter extends DNDDropAdapter<TreeSelection> { - private static final Transfer[] TRANSFERS = new Transfer[] { // CDOObjectTransfer.INSTANCE, - org.eclipse.emf.edit.ui.dnd.LocalTransfer.getInstance() }; + private static final Transfer[] TRANSFERS = new Transfer[] { org.eclipse.emf.edit.ui.dnd.LocalTransfer.getInstance() }; protected CDOObjectDropAdapter(StructuredViewer viewer) { @@ -43,14 +46,16 @@ public class CDOObjectDropAdapter extends DNDDropAdapter<TreeSelection> if (target instanceof IContainer.Modifiable<?>) { IContainer.Modifiable<CDOObject> objectContainer = (IContainer.Modifiable<CDOObject>)target; + ArrayList<CDOObject> elementsToAdd = new ArrayList<CDOObject>(); for (Object obj : data.toArray()) { - if (obj instanceof CDOObject) + if (FSMUtil.isWatchable(obj)) { - objectContainer.addElement((CDOObject)obj); + elementsToAdd.add((CDOObject)obj); } } - + + objectContainer.addAllElements(elementsToAdd); return true; } diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java index 849a059661..d48f4485da 100644 --- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java +++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/editor/CDOEditor.java @@ -1652,7 +1652,7 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv saveOptions.put(CDOResource.OPTION_SAVE_PROGRESS_MONITOR, new SubProgressMonitor(monitor, 1)); resource.save(saveOptions); } - catch (final TransactionException exception) + catch (TransactionException exception) { OM.LOG.error(exception); final Shell shell = getSite().getShell(); @@ -2274,14 +2274,16 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv getSite().getPage().closeEditor(CDOEditor.this, false); CDOEditor.this.dispose(); } - catch (Exception ignore) + catch (RuntimeException ignore) { + // Do nothing } } }); } - catch (Exception ignore) + catch (RuntimeException ignore) { + // Do nothing } } @@ -2307,14 +2309,16 @@ public class CDOEditor extends MultiPageEditorPart implements IEditingDomainProv selectionViewer.refresh(element, true); } } - catch (Exception ignore) + catch (RuntimeException ignore) { + // Do nothing } } }); } - catch (Exception ignore) + catch (RuntimeException ignore) { + // Do nothing } } diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOSubscriptionsView.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOSubscriptionsView.java deleted file mode 100644 index bf8a6e1849..0000000000 --- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOSubscriptionsView.java +++ /dev/null @@ -1,696 +0,0 @@ -/** - * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Victor Roldan Betancort - initial API and implementation - * Eike Stepper - maintenance - */ -package org.eclipse.emf.cdo.internal.ui.views; - -import org.eclipse.emf.cdo.CDOObject; -import org.eclipse.emf.cdo.internal.ui.actions.CDOObjectFilterAction; -import org.eclipse.emf.cdo.internal.ui.actions.RemoveAllContainerItemAction; -import org.eclipse.emf.cdo.internal.ui.actions.RemoveContainerItemAction; -import org.eclipse.emf.cdo.internal.ui.dnd.CDOObjectDropAdapter; -import org.eclipse.emf.cdo.internal.ui.filters.CDOStateFilter; -import org.eclipse.emf.cdo.view.CDOAdapterPolicy; - -import org.eclipse.net4j.util.container.Container; -import org.eclipse.net4j.util.container.IContainer; -import org.eclipse.net4j.util.ui.UIUtil; -import org.eclipse.net4j.util.ui.actions.LongRunningAction; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.Notifier; -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; -import org.eclipse.emf.common.notify.impl.AdapterImpl; -import org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList; -import org.eclipse.emf.common.util.BasicEList; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.edit.EMFEditPlugin; -import org.eclipse.emf.edit.provider.ChangeNotifier; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; -import org.eclipse.emf.edit.provider.IChangeNotifier; -import org.eclipse.emf.edit.provider.IDisposable; -import org.eclipse.emf.edit.provider.INotifyChangedListener; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.viewers.IColorProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyAdapter; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.ui.ISharedImages; -import org.eclipse.ui.IWorkbenchActionConstants; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.part.ViewPart; -import org.eclipse.ui.views.properties.IPropertySheetPage; -import org.eclipse.ui.views.properties.PropertySheetPage; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -/** - * @author Victor Roldan Betancort - */ -public class CDOSubscriptionsView extends ViewPart implements ISelectionProvider -{ - private TableViewer viewer; - - private final String[] columnNames = { "Object", "URI", "State", "Changes" }; - - private final int[] columnWidths = { 100, 300, 75, 250 }; - - private CDOObjectContainer container = new CDOObjectContainer(); - - private ComposedAdapterFactory adapterFactory; - - private WatchListLabelProvider labelProvider; - - private PropertySheetPage propertySheetPage; - - private IAction removeAction; - - private IAction removeAllAction; - - private IAction resetNotificationAction; - - private CDOObjectFilterAction filterAction; - - public CDOSubscriptionsView() - { - adapterFactory = new ComposedAdapterFactory(EMFEditPlugin.getComposedAdapterFactoryDescriptorRegistry()); - // adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); - // adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new CDOObjectContainerAdapterFactory()); - } - - @Override - public void createPartControl(Composite parent) - { - // Create Viewer - getSite().setSelectionProvider(this); - viewer = createViewer(parent); - - // Configure ViewPart - createActions(); - createToolbarButtons(); - createContextMenu(); - hookKeyboardActions(); - createViewPulldownMenu(); - } - - private void createActions() - { - ISharedImages platformImages = PlatformUI.getWorkbench().getSharedImages(); - removeAction = new RemoveContainerItemAction<CDOObject>(container, viewer); - removeAction.setText("Remove"); - removeAction.setImageDescriptor(platformImages.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE)); - removeAction.setDisabledImageDescriptor(platformImages.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED)); - removeAction.setToolTipText("Remove selected subscriptions"); - - removeAllAction = new RemoveAllContainerItemAction<CDOObject>(container); - removeAllAction.setText("Remove All"); - removeAllAction.setImageDescriptor(platformImages.getImageDescriptor(ISharedImages.IMG_OBJS_ERROR_TSK)); - removeAllAction.setToolTipText("Remove all subscriptions"); - - resetNotificationAction = new ResetNotificationAction(); - resetNotificationAction.setText("Reset Changes"); - resetNotificationAction.setImageDescriptor(platformImages.getImageDescriptor(ISharedImages.IMG_TOOL_UNDO)); - resetNotificationAction.setDisabledImageDescriptor(platformImages - .getImageDescriptor(ISharedImages.IMG_TOOL_UNDO_DISABLED)); - resetNotificationAction.setToolTipText("Reset all change notifications from the selected subscriptions"); - } - - private void createToolbarButtons() - { - getViewSite().getActionBars().getToolBarManager().add(removeAction); - removeAction.setEnabled(false); - viewer.addSelectionChangedListener(new ISelectionChangedListener() - { - public void selectionChanged(SelectionChangedEvent event) - { - removeAction.setEnabled(!event.getSelection().isEmpty()); - } - }); - - getViewSite().getActionBars().getToolBarManager().add(resetNotificationAction); - resetNotificationAction.setEnabled(false); - viewer.addSelectionChangedListener(new ISelectionChangedListener() - { - public void selectionChanged(SelectionChangedEvent event) - { - resetNotificationAction.setEnabled(!event.getSelection().isEmpty()); - } - }); - - getViewSite().getActionBars().getToolBarManager().add(removeAllAction); - } - - private void createViewPulldownMenu() - { - ISharedImages platformImages = PlatformUI.getWorkbench().getSharedImages(); - IMenuManager menu = getViewSite().getActionBars().getMenuManager(); - filterAction = new CDOObjectFilterAction(viewer, new CDOStateFilter(viewer)); - filterAction.setText("Filter..."); - filterAction.setImageDescriptor(platformImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE)); - menu.add(filterAction); - } - - private void createContextMenu() - { - MenuManager menuMgr = new MenuManager("#PopupMenu"); - menuMgr.setRemoveAllWhenShown(true); - menuMgr.addMenuListener(new IMenuListener() - { - public void menuAboutToShow(IMenuManager m) - { - CDOSubscriptionsView.this.fillContextMenu(m); - } - }); - - Menu menu = menuMgr.createContextMenu(viewer.getControl()); - viewer.getControl().setMenu(menu); - getSite().registerContextMenu(menuMgr, viewer); - } - - private void fillContextMenu(IMenuManager menuMgr) - { - boolean isEmpty = viewer.getSelection().isEmpty(); - removeAction.setEnabled(!isEmpty); - menuMgr.add(removeAction); - resetNotificationAction.setEnabled(!isEmpty); - menuMgr.add(resetNotificationAction); - menuMgr.add(removeAllAction); - menuMgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); - } - - private void hookKeyboardActions() - { - viewer.getControl().addKeyListener(new KeyAdapter() - { - @Override - public void keyReleased(KeyEvent event) - { - handleKeyReleased(event); - } - }); - } - - protected void handleKeyReleased(KeyEvent event) - { - if (event.character == SWT.DEL && event.stateMask == 0) - { - removeAction.run(); - } - } - - @Override - public void setFocus() - { - } - - public ISelection getSelection() - { - if (viewer != null) - { - return viewer.getSelection(); - } - - return StructuredSelection.EMPTY; - } - - public void setSelection(ISelection selection) - { - // Doesn't need to set viewer.setSelection(). Already done with user event. - } - - public void addSelectionChangedListener(ISelectionChangedListener listener) - { - if (viewer != null) - { - viewer.addSelectionChangedListener(listener); - } - } - - public void removeSelectionChangedListener(ISelectionChangedListener listener) - { - if (viewer != null) - { - viewer.removeSelectionChangedListener(listener); - } - } - - @SuppressWarnings("unchecked") - @Override - public Object getAdapter(Class adapter) - { - if (adapter.equals(IPropertySheetPage.class)) - { - return getPropertySheetPage(); - } - - return super.getAdapter(adapter); - } - - public IPropertySheetPage getPropertySheetPage() - { - if (propertySheetPage == null) - { - propertySheetPage = new PropertySheetPage(); - propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); - } - - return propertySheetPage; - } - - private TableViewer createViewer(Composite parent) - { - TableViewer viewer = new TableViewer(parent, SWT.FULL_SELECTION | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); - viewer.getTable().setLayoutData(UIUtil.createGridData()); - viewer.getTable().setHeaderVisible(true); - viewer.getTable().setLinesVisible(true); - createColumns(viewer.getTable(), columnNames, columnWidths); - viewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - labelProvider = new WatchListLabelProvider(adapterFactory); - viewer.setLabelProvider(labelProvider); - viewer.setInput(container); - CDOObjectDropAdapter.support(viewer); - return viewer; - } - - private void refreshViewer() - { - try - { - viewer.getControl().getDisplay().asyncExec(new Runnable() - { - public void run() - { - try - { - viewer.refresh(); - } - catch (RuntimeException ignore) - { - // Do nothing - } - } - }); - } - catch (RuntimeException ignore) - { - // Do nothing - } - } - - private void createColumns(Table table, String[] columnNames, int[] columnWidths) - { - TableColumn[] columns = new TableColumn[columnNames.length]; - for (int i = 0; i < columns.length; i++) - { - TableColumn column = new TableColumn(table, SWT.LEFT, i); - column.setText(columnNames[i]); - column.setWidth(columnWidths[i]); - column.setMoveable(true); - column.setResizable(true); - } - } - - /** - * @author Eike Stepper - */ - private final class CDOSubscriptionAdapter extends AdapterImpl implements CDOAdapterPolicy - { - public CDOSubscriptionAdapter() - { - } - - @Override - public void notifyChanged(Notification msg) - { - labelProvider.addNotification(msg); - refreshViewer(); - } - - public boolean isValid(EObject object, Adapter adapter) - { - return adapter instanceof CDOSubscriptionAdapter; - } - } - - /** - * Since we want to get the benefits of the usage of AdapterFactoryLabelProvider and AdapterFactoryContentProvider, - * this class extends Notifier so it can be adapted by <code>ComposedAdapterFactory</code>. See - * ComposedAdapterFactory.adapt(Object target, Object type). - * - * @author Victor Roldan Betancort - */ - private final class CDOObjectContainer extends Container<CDOObject> implements Notifier, - IContainer.Modifiable<CDOObject> - { - private BasicEList<Adapter> eAdapters; - - private Set<CDOObject> watchedObjects = new HashSet<CDOObject>(); - - private CDOSubscriptionAdapter subscriptionAdapter = new CDOSubscriptionAdapter(); - - public CDOObjectContainer() - { - } - - public CDOObject[] getElements() - { - return watchedObjects.toArray(new CDOObject[watchedObjects.size()]); - } - - @Override - public boolean isEmpty() - { - return watchedObjects.isEmpty(); - } - - public EList<Adapter> eAdapters() - { - if (eAdapters == null) - { - eAdapters = new EAdapterList<Adapter>(this); - } - - return eAdapters; - } - - public boolean eDeliver() - { - return false; - } - - public void eNotify(Notification notification) - { - // Do nothing - } - - public void eSetDeliver(boolean deliver) - { - // Do nothing - } - - public void addElement(CDOObject element) - { - if (watchedObjects.add(element)) - { - element.cdoView().options().addChangeSubscriptionPolicy(subscriptionAdapter); - element.eAdapters().add(subscriptionAdapter); - refreshViewer(); - } - } - - public void removeElement(CDOObject element) - { - if (watchedObjects.remove(element)) - { - element.eAdapters().remove(subscriptionAdapter); - refreshViewer(); - } - } - } - - /** - * @author Victor Roldan Betancort - */ - private static final class CDOObjectContainerAdapterFactory extends AdapterFactoryImpl implements - ComposeableAdapterFactory, IChangeNotifier, IDisposable - { - private static final Package viewsPackage = CDOSubscriptionsView.class.getPackage(); - - private ComposedAdapterFactory parentAdapterFactory; - - private IChangeNotifier changeNotifier = new ChangeNotifier(); - - private Collection<Object> supportedTypes = new ArrayList<Object>(); - - public CDOObjectContainerAdapterFactory() - { - supportedTypes.add(IStructuredItemContentProvider.class); - } - - public ComposeableAdapterFactory getRootAdapterFactory() - { - return parentAdapterFactory; - } - - @Override - public boolean isFactoryForType(Object type) - { - return type == viewsPackage || type instanceof CDOObjectContainer || supportedTypes.contains(type); - } - - /** - * This implementation substitutes the factory itself as the key for the adapter. - */ - @Override - public Adapter adapt(Notifier notifier, Object type) - { - if (notifier instanceof CDOObjectContainer && IStructuredItemContentProvider.class.equals(type)) - { - return new CDOObjectContainerContentProvider(); - } - - return null; - } - - public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) - { - this.parentAdapterFactory = parentAdapterFactory; - } - - public void addListener(INotifyChangedListener notifyChangedListener) - { - changeNotifier.addListener(notifyChangedListener); - } - - public void removeListener(INotifyChangedListener notifyChangedListener) - { - changeNotifier.removeListener(notifyChangedListener); - } - - public void fireNotifyChanged(Notification notification) - { - changeNotifier.fireNotifyChanged(notification); - if (parentAdapterFactory != null) - { - parentAdapterFactory.fireNotifyChanged(notification); - } - } - - public void dispose() - { - } - } - - /** - * @author Victor Roldan Betancort - */ - private static final class WatchListLabelProvider extends AdapterFactoryLabelProvider implements IColorProvider - { - private static final Color YELLOW = UIUtil.getDisplay().getSystemColor(SWT.COLOR_YELLOW); - - private static final String[] eventTypes = { "CREATE", "SET", "UNSET", "ADD", "REMOVE", "ADD MANY", "REMOVE MANY", - "MOVE", "REMOVING ADAPTER", "RESOLVE" }; - - private HashMap<CDOObject, Notification> notificationMap = new HashMap<CDOObject, Notification>(); - - public WatchListLabelProvider(AdapterFactory adapterFactory) - { - super(adapterFactory); - } - - @Override - public Image getColumnImage(Object object, int columnIndex) - { - switch (columnIndex) - { - case 0: - return super.getColumnImage(object, columnIndex); - - default: - return null; - } - } - - @Override - public String getColumnText(Object element, int columnIndex) - { - CDOObject cdoobject = (CDOObject)element; - switch (columnIndex) - { - case 0: - return super.getText(cdoobject); - - case 1: - return cdoobject.cdoResource().getURI().toString(); - - case 2: - return cdoobject.cdoState().toString(); - - case 3: - Notification notification = notificationMap.get(element); - return createEventLabel(notification); - - default: - return element.toString(); - } - } - - public void addNotification(Notification msg) - { - if (msg.getNotifier() instanceof CDOObject) - { - notificationMap.put((CDOObject)msg.getNotifier(), msg); - } - } - - public void removeNotification(CDOObject cdoobject) - { - notificationMap.remove(cdoobject); - } - - @Override - public Color getBackground(Object element) - { - if (element instanceof CDOObject) - { - if (notificationMap.containsKey(element)) - { - return YELLOW; - } - } - - return super.getBackground(element); - } - - private String createEventLabel(Notification notification) - { - if (notification == null) - { - return null; - } - - StringBuffer eventString = new StringBuffer(); - int event = notification.getEventType(); - if (event < Notification.EVENT_TYPE_COUNT) - { - eventString.append(eventTypes[event]); - } - - eventString.append(": "); - eventString.append(((EStructuralFeature)notification.getFeature()).getName()); - eventString.append(" = "); - eventString.append(notification.getNewValue().toString()); - return eventString.toString(); - } - } - - /** - * @author Victor Roldan Betancort - */ - private static final class CDOObjectContainerContentProvider extends AdapterImpl implements - IStructuredItemContentProvider - { - public CDOObjectContainerContentProvider() - { - } - - public Collection<?> getElements(Object object) - { - Collection<Object> cdoObjects = new ArrayList<Object>(); - if (object instanceof IContainer<?>) - { - for (Object cdoObject : ((IContainer<?>)object).getElements()) - { - cdoObjects.add(cdoObject); - } - } - - return cdoObjects; - } - } - - private final class ResetNotificationAction extends LongRunningAction - { - private transient List<?> targets; - - public ResetNotificationAction() - { - } - - @Override - protected void preRun() throws Exception - { - ISelection selection = getSelection(); - if (selection instanceof IStructuredSelection) - { - IStructuredSelection ssel = (IStructuredSelection)selection; - if (!ssel.isEmpty()) - { - targets = ssel.toList(); - return; - } - } - - cancel(); - } - - @Override - protected void doRun(IProgressMonitor progressMonitor) throws Exception - { - if (targets != null) - { - List<?> useTargets = targets; - targets = null; - - for (Object object : useTargets) - { - if (object instanceof CDOObject) - { - labelProvider.removeNotification((CDOObject)object); - refreshViewer(); - } - } - } - } - } -} diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOWatchListView.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOWatchListView.java new file mode 100644 index 0000000000..e0e993896b --- /dev/null +++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/views/CDOWatchListView.java @@ -0,0 +1,991 @@ +/*************************************************************************** + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Victor Roldan Betancort - initial API and implementation + **************************************************************************/ +package org.eclipse.emf.cdo.internal.ui.views; + +import org.eclipse.emf.cdo.CDODeltaNotification; +import org.eclipse.emf.cdo.CDOObject; +import org.eclipse.emf.cdo.common.revision.CDORevision; +import org.eclipse.emf.cdo.internal.ui.actions.RemoveAllContainerItemAction; +import org.eclipse.emf.cdo.internal.ui.actions.RemoveContainerItemAction; +import org.eclipse.emf.cdo.internal.ui.dnd.CDOObjectDropAdapter; +import org.eclipse.emf.cdo.transaction.CDOCommitContext; +import org.eclipse.emf.cdo.transaction.CDODefaultTransactionHandler; +import org.eclipse.emf.cdo.transaction.CDOTransaction; +import org.eclipse.emf.cdo.view.CDOAdapterPolicy; +import org.eclipse.emf.cdo.view.CDOView; + +import org.eclipse.emf.internal.cdo.util.FSMUtil; + +import org.eclipse.net4j.util.container.Container; +import org.eclipse.net4j.util.container.ContainerEvent; +import org.eclipse.net4j.util.container.IContainer; +import org.eclipse.net4j.util.container.IContainerDelta; +import org.eclipse.net4j.util.event.IEvent; +import org.eclipse.net4j.util.event.IListener; +import org.eclipse.net4j.util.event.INotifier; +import org.eclipse.net4j.util.lifecycle.ILifecycleEvent; +import org.eclipse.net4j.util.ui.UIUtil; +import org.eclipse.net4j.util.ui.actions.LongRunningAction; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.impl.AdapterImpl; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.EMFEditPlugin; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; +import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.action.IMenuListener; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.action.Separator; +import org.eclipse.jface.viewers.IColorProvider; +import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.KeyAdapter; +import org.eclipse.swt.events.KeyEvent; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.ui.ISharedImages; +import org.eclipse.ui.IWorkbenchActionConstants; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.part.ViewPart; +import org.eclipse.ui.views.properties.IPropertySheetPage; +import org.eclipse.ui.views.properties.PropertySheetPage; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * @author Victor Roldan Betancort + */ +public class CDOWatchListView extends ViewPart implements ISelectionProvider +{ + private static final String[] columnNames = { "Object", "Resource", "Time", "Changes" }; + + private static final int[] columnWidths = { 110, 280, 170, 230 }; + + /** + * TODO Vik: Why static? + */ + private static WatchedObjectsDataRegistry dataRegistry = new WatchedObjectsDataRegistry(); + + private TableViewer viewer; + + private CDOObjectContainer container = new CDOObjectContainer(); + + private ComposedAdapterFactory adapterFactory; + + private IPropertySheetPage propertySheetPage; + + private IAction removeAction; + + private IAction removeAllAction; + + private IAction resetNotificationAction; + + private IAction resetAllNotificationAction; + + public CDOWatchListView() + { + adapterFactory = new ComposedAdapterFactory(EMFEditPlugin.getComposedAdapterFactoryDescriptorRegistry()); + container.addListener(dataRegistry); + } + + @Override + public void createPartControl(Composite parent) + { + // Create Viewer + getSite().setSelectionProvider(this); + viewer = createViewer(parent); + + // This listener always refreshes viewer upon notification + IListener refreshListener = new IListener() + { + public void notifyEvent(IEvent event) + { + UIUtil.refreshViewer(viewer); + } + }; + + container.addListener(refreshListener); + dataRegistry.addListener(refreshListener); + + // Configure ViewPart + createActions(); + createToolbarButtons(); + createContextMenu(); + hookKeyboardActions(); + createViewPulldownMenu(); + } + + private void createActions() + { + ISharedImages platformImages = PlatformUI.getWorkbench().getSharedImages(); + removeAction = new RemoveContainerItemAction<CDOObject>(container, viewer); + removeAction.setText("Remove"); + removeAction.setImageDescriptor(platformImages.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE)); + removeAction.setDisabledImageDescriptor(platformImages.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED)); + removeAction.setToolTipText("Remove selected subscriptions"); + + removeAllAction = new RemoveAllContainerItemAction<CDOObject>(container); + removeAllAction.setText("Remove All"); + removeAllAction.setImageDescriptor(platformImages.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE)); + removeAllAction.setToolTipText("Remove all subscriptions"); + + resetNotificationAction = new ResetNotificationAction(); + resetNotificationAction.setText("Reset Changes"); + resetNotificationAction.setImageDescriptor(platformImages.getImageDescriptor(ISharedImages.IMG_TOOL_UNDO)); + resetNotificationAction.setDisabledImageDescriptor(platformImages + .getImageDescriptor(ISharedImages.IMG_TOOL_UNDO_DISABLED)); + resetNotificationAction.setToolTipText("Reset all change notifications from the selected subscriptions"); + + resetAllNotificationAction = new ResetAllNotificationAction(); + resetAllNotificationAction.setText("Reset All Changes"); + resetAllNotificationAction.setImageDescriptor(platformImages.getImageDescriptor(ISharedImages.IMG_TOOL_UNDO)); + resetAllNotificationAction.setDisabledImageDescriptor(platformImages + .getImageDescriptor(ISharedImages.IMG_TOOL_UNDO_DISABLED)); + resetAllNotificationAction.setToolTipText("Reset all change notifications of the subscriptions in the view"); + } + + private void createToolbarButtons() + { + getViewSite().getActionBars().getToolBarManager().add(resetAllNotificationAction); + } + + private void createViewPulldownMenu() + { + IMenuManager menu = getViewSite().getActionBars().getMenuManager(); + menu.add(removeAllAction); + } + + private void createContextMenu() + { + MenuManager menuMgr = new MenuManager("#PopupMenu"); + menuMgr.setRemoveAllWhenShown(true); + menuMgr.addMenuListener(new IMenuListener() + { + public void menuAboutToShow(IMenuManager m) + { + CDOWatchListView.this.fillContextMenu(m); + } + }); + + Menu menu = menuMgr.createContextMenu(viewer.getControl()); + viewer.getControl().setMenu(menu); + getSite().registerContextMenu(menuMgr, viewer); + } + + private void fillContextMenu(IMenuManager menuMgr) + { + boolean isEmpty = viewer.getSelection().isEmpty(); + removeAction.setEnabled(!isEmpty); + menuMgr.add(removeAction); + resetNotificationAction.setEnabled(!isEmpty); + menuMgr.add(resetNotificationAction); + menuMgr.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); + } + + private void hookKeyboardActions() + { + viewer.getControl().addKeyListener(new KeyAdapter() + { + @Override + public void keyReleased(KeyEvent event) + { + handleKeyReleased(event); + } + }); + } + + protected void handleKeyReleased(KeyEvent event) + { + if (event.character == SWT.DEL && event.stateMask == 0) + { + removeAction.run(); + } + } + + @Override + public void setFocus() + { + viewer.getControl().setFocus(); + } + + public ISelection getSelection() + { + if (viewer != null) + { + return viewer.getSelection(); + } + + return StructuredSelection.EMPTY; + } + + public void setSelection(ISelection selection) + { + // Doesn't need to set viewer.setSelection(). Already done with user event. + } + + public void addSelectionChangedListener(ISelectionChangedListener listener) + { + if (viewer != null) + { + viewer.addSelectionChangedListener(listener); + } + } + + public void removeSelectionChangedListener(ISelectionChangedListener listener) + { + if (viewer != null) + { + viewer.removeSelectionChangedListener(listener); + } + } + + @SuppressWarnings("unchecked") + @Override + public Object getAdapter(Class adapter) + { + if (adapter.equals(IPropertySheetPage.class)) + { + return getPropertySheetPage(); + } + + return super.getAdapter(adapter); + } + + public IPropertySheetPage getPropertySheetPage() + { + if (propertySheetPage == null) + { + PropertySheetPage page = new PropertySheetPage(); + page.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); + propertySheetPage = page; + } + + return propertySheetPage; + } + + private TableViewer createViewer(Composite parent) + { + TableViewer viewer = new TableViewer(parent, SWT.FULL_SELECTION | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); + viewer.getTable().setLayoutData(UIUtil.createGridData()); + viewer.getTable().setHeaderVisible(true); + viewer.getTable().setLinesVisible(true); + createColumns(viewer.getTable()); + + viewer.setContentProvider(new CDOObjectContainerContentProvider()); + viewer.setLabelProvider(new CDOSubscriptionViewLabelProvider(adapterFactory)); + viewer.setInput(container); + + CDOObjectDropAdapter.support(viewer); + return viewer; + } + + private void createColumns(Table table) + { + TableColumn[] columns = new TableColumn[columnNames.length]; + for (int i = 0; i < columns.length; i++) + { + TableColumn column = new TableColumn(table, SWT.LEFT, i); + column.setText(columnNames[i]); + column.setWidth(columnWidths[i]); + column.setMoveable(true); + column.setResizable(true); + } + } + + /** + * @author Victor Roldan Betancort + */ + private final class TransactionHandler extends CDODefaultTransactionHandler + { + public TransactionHandler() + { + } + + @Override + public void committedTransaction(CDOTransaction transaction, CDOCommitContext commitContext) + { + container.removeAllElements(commitContext.getDetachedObjects().values()); + UIUtil.refreshViewer(viewer); + } + } + + /** + * @author Victor Roldan Betancort + */ + private final class CDOSubscriptionAdapter extends AdapterImpl implements CDOAdapterPolicy + { + public CDOSubscriptionAdapter() + { + } + + @Override + public void notifyChanged(Notification msg) + { + if (msg instanceof CDODeltaNotification) + { + checkDetached(msg); + // TODO how to retrieve remote commit timestamp? + dataRegistry.addNotification(msg); + } + } + + private void checkDetached(Notification msg) + { + // TODO Remote detach won't be shown in the UI, the object will be just removed from the viewer + if (((CDODeltaNotification)msg).getEventType() == CDODeltaNotification.DETACH_OBJECT) + { + Object obj = msg.getNotifier(); + container.removeElement((CDOObject)obj); + dataRegistry.removeData(obj); + } + } + + public boolean isValid(EObject object, Adapter adapter) + { + return adapter instanceof CDOSubscriptionAdapter; + } + } + + /** + * @author Victor Roldan Betancort + */ + private final class CDOObjectContainer extends Container<CDOObject> implements IContainer.Modifiable<CDOObject> + { + private Set<CDOObject> watchedObjects = new HashSet<CDOObject>(); + + private CDOSubscriptionAdapter subscriptionAdapter = new CDOSubscriptionAdapter(); + + private ViewDeactivationListener viewDeactivationListener = new ViewDeactivationListener(); + + private TransactionHandler transactionHandler = new TransactionHandler(); + + public CDOObjectContainer() + { + } + + public CDOObject[] getElements() + { + return watchedObjects.toArray(new CDOObject[watchedObjects.size()]); + } + + @Override + public boolean isEmpty() + { + return watchedObjects.isEmpty(); + } + + /** + * @returns true if the element was added successfully to the container + */ + public boolean addElement(CDOObject element) + { + if (watchedObjects.add(element)) + { + postAdd(element); + fireElementAddedEvent(element); + return true; + } + + return false; + } + + /** + * @returns true if the element was removed successfully from the container + */ + public boolean removeElement(CDOObject element) + { + if (watchedObjects.remove(element)) + { + postRemove(element); + fireElementRemovedEvent(element); + return true; + } + + return false; + } + + /** + * @returns true if at least one element was added. False otherwise. + */ + public boolean addAllElements(Collection<CDOObject> elements) + { + ArrayList<CDOObject> addedElements = new ArrayList<CDOObject>(); + for (CDOObject cdoObject : elements) + { + if (watchedObjects.add(cdoObject)) + { + postAdd(cdoObject); + addedElements.add(cdoObject); + } + } + + if (!addedElements.isEmpty()) + { + fireElementsAddedEvent(addedElements.toArray(new CDOObject[addedElements.size()])); + return true; + } + + return false; + } + + /** + * @returns true if at least one element was removed. False otherwise. + */ + public boolean removeAllElements(Collection<CDOObject> elements) + { + ArrayList<CDOObject> removedElements = new ArrayList<CDOObject>(); + for (CDOObject cdoObject : elements) + { + if (watchedObjects.remove(cdoObject)) + { + postRemove(cdoObject); + removedElements.add(cdoObject); + } + } + + if (!removedElements.isEmpty()) + { + fireElementsRemovedEvent(removedElements.toArray(new CDOObject[removedElements.size()])); + return true; + } + + return false; + } + + private void postAdd(CDOObject element) + { + element.cdoView().options().addChangeSubscriptionPolicy(subscriptionAdapter); + element.eAdapters().add(subscriptionAdapter); + increaseViewReference(element); + } + + private void postRemove(CDOObject element) + { + decreaseViewReference(element); + CDOView view = element.cdoView(); + if (view != null && !view.isClosed()) + { + element.eAdapters().remove(subscriptionAdapter); + } + } + + private void increaseViewReference(CDOObject referrer) + { + CDOViewReferenceCounter counter = CDOViewReferenceCounter.getCounter(referrer); + if (counter.increase() == 1) + { + CDOView view = referrer.cdoView(); + view.addListener(viewDeactivationListener); + if (view instanceof CDOTransaction) + { + ((CDOTransaction)view).addHandler(transactionHandler); + } + } + } + + private void decreaseViewReference(CDOObject referrer) + { + CDOViewReferenceCounter counter = CDOViewReferenceCounter.getCounter(referrer); + + // CDOObject might be detached, and so CDOView will be null + if (counter.decrease() == 0 && referrer.cdoView() != null) + { + CDOView view = referrer.cdoView(); + view.removeListener(viewDeactivationListener); + if (view instanceof CDOTransaction) + { + ((CDOTransaction)view).removeHandler(transactionHandler); + } + } + } + + /** + * @author Victor Roldan Betancort + */ + private final class ViewDeactivationListener implements IListener + { + public void notifyEvent(IEvent event) + { + if (event instanceof ILifecycleEvent) + { + if (((ILifecycleEvent)event).getKind() == ILifecycleEvent.Kind.ABOUT_TO_DEACTIVATE) + { + ArrayList<CDOObject> aboutToRemove = new ArrayList<CDOObject>(); + for (CDOObject object : getElements()) + { + if (object.cdoView().equals(event.getSource())) + { + aboutToRemove.add(object); + } + } + + removeAllElements(aboutToRemove); + } + } + } + } + } + + /** + * @author Victor Roldan Betancort + */ + private static final class CDOViewReferenceCounter + { + /** + * TODO Vik: Why static? + */ + private static ArrayList<CDOViewReferenceCounter> viewReferences = new ArrayList<CDOViewReferenceCounter>(); + + private final CDOObject referrer; + + private final CDOView view; + + private long referenceCount; + + /** + * TODO Vik: Why private? + */ + private CDOViewReferenceCounter(CDOView view, CDOObject cdoObject) + { + this.view = view; + referrer = cdoObject; + referenceCount = 0; + } + + public synchronized long getCount() + { + return referenceCount; + } + + public synchronized long increase() + { + return ++referenceCount; + } + + public synchronized long decrease() + { + if (--referenceCount == 0) + { + viewReferences.remove(this); + } + return referenceCount; + } + + public CDOView getView() + { + return view; + } + + public CDOObject getReferrer() + { + return referrer; + } + + /** + * TODO Vik: Why static? + */ + public static CDOViewReferenceCounter getCounter(CDOObject cdoObject) + { + synchronized (viewReferences) + { + for (CDOViewReferenceCounter registeredCounter : viewReferences) + { + if (registeredCounter.getReferrer().equals(cdoObject)) + { + return registeredCounter; + } + } + } + + CDOViewReferenceCounter counter = new CDOViewReferenceCounter(cdoObject.cdoView(), cdoObject); + viewReferences.add(counter); + return counter; + } + } + + /** + * @author Victor Roldan Betancort + */ + private static final class WatchedObjectsDataRegistry extends org.eclipse.net4j.util.event.Notifier implements + IListener + { + private Map<Object, WatchedObjectData> registry = new HashMap<Object, WatchedObjectData>(); + + private final IEvent dataRegistryEvent = new IEvent() + { + public INotifier getSource() + { + return WatchedObjectsDataRegistry.this; + } + }; + + public WatchedObjectsDataRegistry() + { + } + + public WatchedObjectData getData(Object object) + { + WatchedObjectData data = registry.get(object); + if (data == null) + { + data = new WatchedObjectData(); + registry.put(object, data); + } + return data; + } + + public void addNotification(Notification msg) + { + getData(msg.getNotifier()).setNotification(msg); + fireEvent(dataRegistryEvent); + } + + public void removeNotification(Object object) + { + getData(object).deleteNotification(); + fireEvent(dataRegistryEvent); + } + + public void removeData(Object object) + { + registry.remove(object); + } + + public void removeAllNotification(Collection<Object> objects) + { + for (WatchedObjectData data : registry.values()) + { + data.deleteNotification(); + } + + fireEvent(dataRegistryEvent); + } + + public Notification getNotification(Object object) + { + return getData(object).getNotification(); + } + + public void addLastCommitTime(Object object, long timeStamp) + { + getData(object).setCommitTimeStamp(timeStamp); + fireEvent(dataRegistryEvent); + } + + public Long getLastCommitTime(Object object) + { + return getData(object).getCommitTimeStamp(); + } + + public void notifyEvent(IEvent event) + { + if (event instanceof ContainerEvent<?>) + { + ContainerEvent<?> containerEvent = (ContainerEvent<?>)event; + for (IContainerDelta<?> delta : containerEvent.getDeltas()) + { + if (delta.getKind().equals(IContainerDelta.Kind.REMOVED)) + { + removeData(delta.getElement()); + } + } + } + } + + /** + * @author Victor Roldan Betancort + */ + private static final class WatchedObjectData + { + private Notification notification; + + private long commitTimeStamp; + + public WatchedObjectData() + { + } + + public void setNotification(Notification notification) + { + this.notification = notification; + } + + public void deleteNotification() + { + notification = null; + } + + public Notification getNotification() + { + return notification; + } + + public void setCommitTimeStamp(long commitTimeStamp) + { + this.commitTimeStamp = commitTimeStamp; + } + + public long getCommitTimeStamp() + { + return commitTimeStamp; + } + } + } + + /** + * @author Victor Roldan Betancort + */ + private static final class CDOSubscriptionViewLabelProvider extends LabelProvider implements ILabelProvider, + ITableLabelProvider, IColorProvider + { + private static final Color YELLOW = UIUtil.getDisplay().getSystemColor(SWT.COLOR_YELLOW); + + private static final String[] eventTypes = { "CREATE", "SET", "UNSET", "ADD", "REMOVE", "ADD MANY", "REMOVE MANY", + "MOVE", "REMOVING ADAPTER", "RESOLVE" }; + + private static AdapterFactory adapterFactory; + + public CDOSubscriptionViewLabelProvider(AdapterFactory adapterFactory) + { + CDOSubscriptionViewLabelProvider.adapterFactory = adapterFactory; + } + + public Image getColumnImage(Object object, int columnIndex) + { + // In case an invalid object arrives (i.e., detached), return CDOState + if (FSMUtil.isInvalid((CDOObject)object)) + { + return null; + } + switch (columnIndex) + { + case 0: + IItemLabelProvider labelProvider = (IItemLabelProvider)adapterFactory.adapt(object, IItemLabelProvider.class); + if (labelProvider != null) + { + return ExtendedImageRegistry.getInstance().getImage(labelProvider.getImage(object)); + } + + default: + return null; + } + } + + public String getColumnText(Object element, int columnIndex) + { + CDOObject object = (CDOObject)element; + + // In case an invalid object arrives (i.e., detached), return CDOState + if (FSMUtil.isInvalid(object)) + { + return object.cdoState().toString(); + } + + switch (columnIndex) + { + case 0: + IItemLabelProvider labelProvider = (IItemLabelProvider)adapterFactory.adapt(object, IItemLabelProvider.class); + if (labelProvider != null) + { + return labelProvider.getText(object); + } + + return null; + + case 1: + return object.cdoResource().getURI().toString(); + + case 2: + CDOView view = object.cdoView(); + if (view instanceof CDOTransaction) + { + long time = ((CDOTransaction)view).getLastCommitTime(); + if (time != CDORevision.UNSPECIFIED_DATE) + { + return new Date(time).toString(); + } + } + + return "?"; + + case 3: + Notification notification = dataRegistry.getNotification(element); + return createEventLabel(notification); + } + + return element.toString(); + } + + public Color getBackground(Object element) + { + if (element instanceof CDOObject) + { + if (dataRegistry.getNotification(element) != null) + { + return YELLOW; + } + } + + return null; + } + + public Color getForeground(Object element) + { + return null; + } + + private String createEventLabel(Notification notification) + { + if (notification == null) + { + return null; + } + + StringBuilder builder = new StringBuilder(); + int event = notification.getEventType(); + if (event < Notification.EVENT_TYPE_COUNT) + { + builder.append(eventTypes[event]); + } + + builder.append(": "); + builder.append(((EStructuralFeature)notification.getFeature()).getName()); + builder.append(" = "); + builder.append(notification.getNewValue().toString()); + return builder.toString(); + } + } + + /** + * @author Victor Roldan Betancort + */ + private static final class CDOObjectContainerContentProvider implements IStructuredContentProvider + { + public CDOObjectContainerContentProvider() + { + } + + @SuppressWarnings("unchecked") + public Object[] getElements(Object object) + { + return ((IContainer<Object>)object).getElements(); + } + + public void dispose() + { + // do nothing + } + + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) + { + // do nothing + } + } + + /** + * @author Victor Roldan Betancort + */ + private final class ResetNotificationAction extends LongRunningAction + { + private transient List<?> targets; + + public ResetNotificationAction() + { + } + + @Override + protected void preRun() throws Exception + { + ISelection selection = getSelection(); + if (selection instanceof IStructuredSelection) + { + IStructuredSelection ssel = (IStructuredSelection)selection; + if (!ssel.isEmpty()) + { + targets = ssel.toList(); + return; + } + } + + cancel(); + } + + @Override + protected void doRun(IProgressMonitor progressMonitor) throws Exception + { + if (targets != null) + { + List<?> useTargets = targets; + targets = null; + + for (Object object : useTargets) + { + if (object instanceof CDOObject) + { + dataRegistry.removeNotification(object); + } + } + } + } + } + + /** + * @author Victor Roldan Betancort + */ + private final class ResetAllNotificationAction extends LongRunningAction + { + public ResetAllNotificationAction() + { + } + + @Override + protected void doRun(IProgressMonitor progressMonitor) throws Exception + { + ArrayList<Object> aboutToReset = new ArrayList<Object>(); + for (CDOObject cdoObject : container.getElements()) + { + aboutToReset.add(cdoObject); + } + + dataRegistry.removeAllNotification(aboutToReset); + } + } +} diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDONet4jUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDONet4jUtil.java index 8ba73209e7..1e16188097 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDONet4jUtil.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDONet4jUtil.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDOSession.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDOSession.java index 4a03d4dc96..ce0dfbfc7c 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDOSession.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDOSession.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDOSessionConfiguration.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDOSessionConfiguration.java index 94a6e68ee2..d397ddc677 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDOSessionConfiguration.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/net4j/CDOSessionConfiguration.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionConfigurationImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionConfigurationImpl.java index 6290b124df..829a4baf9e 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionConfigurationImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionConfigurationImpl.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionFactory.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionFactory.java index 160755bb53..4e1168081e 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionFactory.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionFactory.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionImpl.java index c5885038bd..9fd774d9e6 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/CDONet4jSessionImpl.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/FailOverStrategyInjector.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/FailOverStrategyInjector.java index 54dad74b48..d647246a3b 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/FailOverStrategyInjector.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/FailOverStrategyInjector.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientIndication.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientIndication.java index 3a2654d8de..4d5ae358cc 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientIndication.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientIndication.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientProtocol.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientProtocol.java index 55271ca0dd..7141432a04 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientProtocol.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientProtocol.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientProtocolFactory.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientProtocolFactory.java index 880c15fe1a..ee16bcdd5d 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientProtocolFactory.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientProtocolFactory.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientRequest.java index 77e01b426f..84f8c1e5ca 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOClientRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOTimeRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOTimeRequest.java index 3430f4a36a..275d037ceb 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOTimeRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CDOTimeRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ChangeSubscriptionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ChangeSubscriptionRequest.java index 278ec61fa6..85163bfca9 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ChangeSubscriptionRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ChangeSubscriptionRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitNotificationIndication.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitNotificationIndication.java index 6eeff83345..45aaeb5b52 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitNotificationIndication.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitNotificationIndication.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionCancelRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionCancelRequest.java index 87313f3257..4c9941983d 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionCancelRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionCancelRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase1Request.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase1Request.java index 904ebb7c2c..5da1fb12fc 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase1Request.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase1Request.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase2Request.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase2Request.java index 37c295dd97..a79313e2c2 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase2Request.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase2Request.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase3Request.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase3Request.java index c63da59f6b..caab413d98 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase3Request.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionPhase3Request.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionRequest.java index 271cb48dad..adecc57212 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/CommitTransactionRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/GetRemoteSessionsRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/GetRemoteSessionsRequest.java index e6dae5fbee..718aac382e 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/GetRemoteSessionsRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/GetRemoteSessionsRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadChunkRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadChunkRequest.java index 9be6f77a75..0a87f07363 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadChunkRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadChunkRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadLibrariesRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadLibrariesRequest.java index 8248cd769a..2218310147 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadLibrariesRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadLibrariesRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadPackageRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadPackageRequest.java index f0efd04cca..00ad4ad316 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadPackageRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadPackageRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByTimeRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByTimeRequest.java index 06f63f5f35..02c34b1975 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByTimeRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByTimeRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByVersionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByVersionRequest.java index 48110d8621..55a4428786 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByVersionRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionByVersionRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionRequest.java index 48919f6e10..17b5f8fefc 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LoadRevisionRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LockObjectsRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LockObjectsRequest.java index 019a4147e0..ac62f2112c 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LockObjectsRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/LockObjectsRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ObjectLockedRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ObjectLockedRequest.java index 5ff6c79bd0..5f67a7238d 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ObjectLockedRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ObjectLockedRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/OpenSessionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/OpenSessionRequest.java index 3bb51f82e1..6f524fe599 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/OpenSessionRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/OpenSessionRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryCancelRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryCancelRequest.java index bb48b83caa..cad541d4c5 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryCancelRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryCancelRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryRequest.java index 7bede39a6e..a68c8a9927 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/QueryRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/RemoteSessionNotificationIndication.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/RemoteSessionNotificationIndication.java index 613b4b11fd..579a36b663 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/RemoteSessionNotificationIndication.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/RemoteSessionNotificationIndication.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/RepositoryTimeRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/RepositoryTimeRequest.java index ab9466aaf5..f41f0d248b 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/RepositoryTimeRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/RepositoryTimeRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ResourceIDRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ResourceIDRequest.java index cfdffdb9d7..ac00447092 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ResourceIDRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ResourceIDRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetAuditRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetAuditRequest.java index f53990c850..9f157eeb02 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetAuditRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetAuditRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetPassiveUpdateRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetPassiveUpdateRequest.java index 17ee873ecb..0454f46e12 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetPassiveUpdateRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SetPassiveUpdateRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java index 6e18bc9ae2..dc9d4bfe67 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/SyncRevisionsRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/UnlockObjectsRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/UnlockObjectsRequest.java index 978dda818b..80df6d4fd6 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/UnlockObjectsRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/UnlockObjectsRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/UnsubscribeRemoteSessionsRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/UnsubscribeRemoteSessionsRequest.java index 73d35f1ba3..7eaa622f7c 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/UnsubscribeRemoteSessionsRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/UnsubscribeRemoteSessionsRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/VerifyRevisionRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/VerifyRevisionRequest.java index 996869515e..c2f64a529e 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/VerifyRevisionRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/VerifyRevisionRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ViewsChangedRequest.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ViewsChangedRequest.java index a31ff13c4a..88d936b376 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ViewsChangedRequest.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/net4j/protocol/ViewsChangedRequest.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/AbstractSavepoint.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/AbstractSavepoint.java index ad4c1b8df2..db8d6812e6 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/AbstractSavepoint.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/AbstractSavepoint.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java index afc2bc7b8e..b0a4a81e46 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOSingleTransactionStrategyImpl.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java index b2aca39d28..62d62eda7c 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXASavepointImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXASavepointImpl.java index 575d258511..fc5471f370 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXASavepointImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXASavepointImpl.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java index f64132b9fb..71d67cca35 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java @@ -75,6 +75,18 @@ public final class FSMUtil || object instanceof org.eclipse.emf.ecore.impl.EStringToStringMapEntryImpl; } + public static boolean isWatchable(Object obj) + { + // Only CLEAN and DIRTY CDOObjects are watchable + if (obj instanceof CDOObject) + { + CDOObject cdoObject = (CDOObject)obj; + return cdoObject.cdoState() == CDOState.CLEAN || cdoObject.cdoState() == CDOState.DIRTY; + } + + return false; + } + /** * @param view * Only needed if object is a meta instance. diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/AbstractObjectConflictResolver.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/AbstractObjectConflictResolver.java index b7fefee024..36b4b8bb0c 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/AbstractObjectConflictResolver.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/AbstractObjectConflictResolver.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/AbstractQueryIterator.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/AbstractQueryIterator.java index 812b8a2a5d..d1aa42e5fa 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/AbstractQueryIterator.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/AbstractQueryIterator.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java index 7df6860cf2..a4220e17ee 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/CDOSessionProtocol.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOXATransaction.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOXATransaction.java index 227b552364..d02d8983ce 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOXATransaction.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOXATransaction.java @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2004 - 2008 Eike Stepper, Germany. + * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) 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 diff --git a/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/views/RemoteTraceView.java b/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/views/RemoteTraceView.java index 3e0451801d..42e8dc613f 100644 --- a/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/views/RemoteTraceView.java +++ b/plugins/org.eclipse.net4j.debug/src/org/eclipse/net4j/internal/debug/views/RemoteTraceView.java @@ -14,6 +14,7 @@ import org.eclipse.net4j.internal.debug.RemoteTraceManager; import org.eclipse.net4j.util.ObjectUtil; import org.eclipse.net4j.util.ReflectUtil; import org.eclipse.net4j.util.om.trace.RemoteTraceServer.Event; +import org.eclipse.net4j.util.ui.UIUtil; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IMenuListener; @@ -114,24 +115,7 @@ public class RemoteTraceView extends ViewPart public void refreshViewer() { - if (isViewerAlive()) - { - getSite().getShell().getDisplay().asyncExec(new Runnable() - { - public void run() - { - if (isViewerAlive()) - { - viewer.refresh(); - } - } - }); - } - } - - private boolean isViewerAlive() - { - return viewer != null && viewer.getControl() != null && !viewer.getControl().isDisposed(); + UIUtil.refreshViewer(viewer); } private void hookContextMenu() diff --git a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/internal/ui/views/Net4jIntrospectorView.java b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/internal/ui/views/Net4jIntrospectorView.java index 6c6b4a09b3..b998821a50 100644 --- a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/internal/ui/views/Net4jIntrospectorView.java +++ b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/internal/ui/views/Net4jIntrospectorView.java @@ -209,25 +209,7 @@ public class Net4jIntrospectorView extends ViewPart implements ISelectionListene public void refreshViewer() { - try - { - currentViewer.getControl().getDisplay().asyncExec(new Runnable() - { - public void run() - { - try - { - currentViewer.refresh(); - } - catch (RuntimeException ignore) - { - } - } - }); - } - catch (RuntimeException ignore) - { - } + UIUtil.refreshViewer(currentViewer); } public void selectionChanged(IWorkbenchPart part, ISelection sel) diff --git a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/UIUtil.java b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/UIUtil.java index 069e239ac0..bc12539112 100644 --- a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/UIUtil.java +++ b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/UIUtil.java @@ -17,6 +17,7 @@ import org.eclipse.jface.fieldassist.FieldDecoration; import org.eclipse.jface.fieldassist.FieldDecorationRegistry; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.Viewer; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Font; @@ -265,4 +266,32 @@ public final class UIUtil } } } + + /** + * @since 2.0 + */ + public static void refreshViewer(final Viewer viewer) + { + try + { + viewer.getControl().getDisplay().asyncExec(new Runnable() + { + public void run() + { + try + { + viewer.refresh(); + } + catch (RuntimeException ignore) + { + // Do nothing + } + } + }); + } + catch (RuntimeException ignore) + { + // Do nothing + } + } } diff --git a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/actions/LongRunningAction.java b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/actions/LongRunningAction.java index b472a31564..8f4c88b4f3 100644 --- a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/actions/LongRunningAction.java +++ b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/actions/LongRunningAction.java @@ -96,11 +96,6 @@ public abstract class LongRunningAction extends SafeAction super(text); } - public void setPage(IWorkbenchPage page) - { - this.page = page; - } - public IWorkbenchPage getPage() { if (page != null) @@ -117,6 +112,11 @@ public abstract class LongRunningAction extends SafeAction return null; } + public void setPage(IWorkbenchPage page) + { + this.page = page; + } + public IWorkbenchWindow getWorkbenchWindow() { if (page != null) diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/container/Container.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/container/Container.java index ddde282545..e3acb4545d 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/container/Container.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/container/Container.java @@ -36,6 +36,20 @@ public abstract class Container<E> extends Lifecycle implements IContainer<E> return elements == null || elements.length == 0; } + @Override + public void fireEvent(IEvent event) + { + if (event instanceof IContainerEvent<?>) + { + if (((IContainerEvent<?>)event).isEmpty()) + { + return; + } + } + + super.fireEvent(event); + } + public void fireContainerEvent(E element, Kind kind) { fireEvent(newContainerEvent(element, kind)); @@ -95,18 +109,4 @@ public abstract class Container<E> extends Lifecycle implements IContainer<E> { return new ContainerEvent<E>(this); } - - @Override - public void fireEvent(IEvent event) - { - if (event instanceof IContainerEvent<?>) - { - if (((IContainerEvent<?>)event).isEmpty()) - { - return; - } - } - - super.fireEvent(event); - } } diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/container/IContainer.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/container/IContainer.java index 547eb57b18..365a10147a 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/container/IContainer.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/container/IContainer.java @@ -7,11 +7,14 @@ * * Contributors: * Eike Stepper - initial API and implementation + * Victor Roldan Betancort - maintenance */ package org.eclipse.net4j.util.container; import org.eclipse.net4j.util.event.INotifier; +import java.util.Collection; + /** * @author Eike Stepper */ @@ -27,8 +30,12 @@ public interface IContainer<E> extends INotifier */ public interface Modifiable<E> extends IContainer<E> { - public void addElement(E element); + public boolean addElement(E element); + + public boolean addAllElements(Collection<E> elements); + + public boolean removeElement(E element); - public void removeElement(E element); + public boolean removeAllElements(Collection<E> elements); } } |