• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2009 The Android Open Source Project
3  *
4  * Licensed under the Eclipse Public License, Version 1.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.eclipse.org/org/documents/epl-v10.php
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.ide.eclipse.adt.internal.editors.layout;
18 
19 import com.android.ide.eclipse.adt.internal.editors.layout.parts.ElementCreateCommand;
20 import com.android.ide.eclipse.adt.internal.editors.uimodel.UiDocumentNode;
21 import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode;
22 import com.android.ide.eclipse.adt.internal.resources.configurations.FolderConfiguration;
23 
24 import org.eclipse.gef.ui.parts.SelectionSynchronizer;
25 import org.eclipse.swt.dnd.Clipboard;
26 import org.eclipse.ui.IEditorPart;
27 
28 /**
29  * Interface defining what {@link LayoutEditor} expects from a GraphicalLayoutEditor part.
30  *
31  * @since GLE2
32  */
33 /*package*/ interface IGraphicalLayoutEditor extends IEditorPart {
34 
35     /**
36      * Sets the UI for the edition of a new file.
37      * @param configuration the configuration of the new file.
38      */
editNewFile(FolderConfiguration configuration)39     abstract void editNewFile(FolderConfiguration configuration);
40 
41     /**
42      * Reloads this editor, by getting the new model from the {@link LayoutEditor}.
43      */
reloadEditor()44     abstract void reloadEditor();
45 
46     /**
47      * Callback for XML model changed. Only update/recompute the layout if the editor is visible
48      */
onXmlModelChanged()49     abstract void onXmlModelChanged();
50 
51     /**
52      * Responds to a page change that made the Graphical editor page the activated page.
53      */
activated()54     abstract void activated();
55 
56     /**
57      * Responds to a page change that made the Graphical editor page the deactivated page
58      */
deactivated()59     abstract void deactivated();
60 
61     /**
62      * Used by LayoutEditor.UiEditorActions.selectUiNode to select a new UI Node
63      * created by  {@link ElementCreateCommand#execute()}.
64      *
65      * @param uiNodeModel The {@link UiElementNode} to select.
66      */
selectModel(UiElementNode uiNodeModel)67     abstract void selectModel(UiElementNode uiNodeModel);
68 
69     /**
70      * Returns the selection synchronizer object.
71      * The synchronizer can be used to sync the selection of 2 or more EditPartViewers.
72      */
getSelectionSynchronizer()73     abstract public SelectionSynchronizer getSelectionSynchronizer();
74 
reloadPalette()75     abstract void reloadPalette();
76 
recomputeLayout()77     abstract void recomputeLayout();
78 
getModel()79     abstract UiDocumentNode getModel();
80 
getLayoutEditor()81     abstract LayoutEditor getLayoutEditor();
82 
getClipboard()83     abstract Clipboard getClipboard();
84 
reloadConfigurationUi(boolean notifyListener)85     abstract void reloadConfigurationUi(boolean notifyListener);
86 
87 }
88