Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 12287d393fe6bc8faeef3038fa2012c13ec54dfc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/*
 * Copyright (c) 2004 - 2011 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:
 *    Martin Fluegge - initial API and implementation
 */
package org.eclipse.emf.cdo.dawn.spi;

import org.eclipse.emf.cdo.view.CDOView;

import java.util.List;
import java.util.Map;

/**
 * The IDawnEditingSupport is the direct connection the the Dawn Runtime. Service Providers must implement this
 * interface to react on repository changes or local data manipulation. For implementation example @see
 * org.eclipse.emf.cdo.dawn.gmf.editors.impl.DawnGMFEditorSupport.
 * 
 * @author Martin Fluegge
 * @since 2.0
 */
public interface IDawnEditingSupport
{
  /**
   * Sets the element dirty. Implementations must ensure that all necessary operations a made to represent a dirty
   * state. E.g. display the state in the user interface.
   */
  public void setDirty(boolean dirty);

  /**
   * Returns the dirty state of the UI element.
   * 
   * @return true if the specific parts of the model that should be reflected as dirty to the UI are dirty, else
   *         otherwise.
   */
  public boolean isDirty();

  /**
   * Returns the CDO view that is responsible for the data represented be the IDawnEditingSupport.
   */
  public CDOView getView();

  /**
   * Sets the CDO view that is responsible for the data represented be the IDawnEditingSupport.
   */
  public void setView(CDOView view);

  /**
   * Handles all actions that must be executed when the UI element ist closed. E.g. close the related view.
   */
  public void close();

  /**
   * Registers the default listeners which are used to interact with the repository and the user interface.
   */
  public void registerListeners();

  /**
   * Implementations must process all operations that are need to provide a clean rollback. This includes the rollback
   * on the repository site and the refreshing of the user interface.
   * 
   * @since 1.0
   */
  public void rollback();

  /**
   * Refreshes the internal components of the IDawnEditor
   * 
   * @since 2.0
   */
  public void refresh();

  /**
   * Locks the objects
   * 
   * @since 2.0
   */
  public void lockObjects(List<Object> objectsToBeLocked);

  /**
   * @since 2.0
   */
  public void lockObject(Object objectToBeLocked);

  /**
   * Unlocks the objects
   * 
   * @since 2.0
   */
  public void unlockObjects(List<Object> objectsToBeLocked);

  /**
   * @since 2.0
   */
  public void unlockObject(Object objectToBeUnlocked);

  /**
   * Implementations must handle all operations which are necessary on remotely locked objects, like disabling them,
   * providing specific markers, like colors or icons, and so on.
   * 
   * @since 2.0
   */
  public void handleRemoteLockChanges(Map<Object, DawnState> changedObjects);
}

Back to the top