import org.eclipse.gef.commands.CommandStack;
import org.eclipse.gef.ui.actions.ActionRegistry;
import org.eclipse.gef.ui.actions.UpdateAction;
+import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FillLayout;
import org.tizen.webuibuilder.ui.views.databinding.actions.SetTargetAction;
import org.tizen.webuibuilder.ui.views.databinding.model.BindingData;
import org.tizen.webuibuilder.ui.views.databinding.model.BindingDataSetEvent;
+import org.tizen.webuibuilder.ui.views.databinding.model.BindingDataSetEvent.BindingDataSetEventType;
import org.tizen.webuibuilder.ui.views.databinding.model.BindingObject;
import org.tizen.webuibuilder.ui.views.databinding.model.IBindingDataSetListener;
import org.tizen.webuibuilder.ui.views.databinding.model.TreeItemData;
-import org.tizen.webuibuilder.ui.views.databinding.model.BindingDataSetEvent.BindingDataSetEventType;
import org.tizen.webuibuilder.utility.ResourceManager;
public class DataBindingPage extends Page implements IBindingDataSetListener {
private IProject project;
- //TODO appManager
+ // TODO appManager
private ProjectManager projectManager;
private Composite composite;
private Tree viewModelTree;
private MenuManager dataSourceMenuManager;
private MenuManager viewModelMenuManager;
private MenuManager bindingInfoMenuManager;
-
+
private AddViewModelAction addViewModelAction;
private AddViewModelItemAction addViewModelItemAction;
private EditDataSourceAction editDataModelAction;
private List<Part> pageList = new ArrayList<Part>();
private IAction undoHandler;
private IAction redoHandler;
- //private List<String> itemPath;
+
+ private boolean showBindInfo = false;
+
+ // private List<String> itemPath;
public DataBindingPage(DataBindingView dataBindingView) {
this.dataBindingView = dataBindingView;
}
-
+
private void addListeners(Part model) {
- if (pageDesigner != null) {
- PageData pageData = pageDesigner.getAppManager().getPageData(model.getPropertyValue("id"));
- pageData.addPageListener(delegater);
- }
+ if (pageDesigner != null) {
+ PageData pageData =
+ pageDesigner.getAppManager().getPageData(model.getPropertyValue("id"));
+ pageData.addPageListener(delegater);
+ }
}
-
+
private void removeListeners(Part model) {
- if (pageDesigner != null) {
- PageData pageData = pageDesigner.getAppManager().getPageData(model.getPropertyValue("id"));
- pageData.removePageListener(delegater);
- }
+ if (pageDesigner != null) {
+ PageData pageData =
+ pageDesigner.getAppManager().getPageData(model.getPropertyValue("id"));
+ pageData.removePageListener(delegater);
+ }
}
/**
updateDataSourceToAppManager(dataSourceTree);
updateViewModelToAppManager(viewModelTree);
- //FIXME
- //pageDesigner.getAppManager().save();
+ // FIXME
+ // pageDesigner.getAppManager().save();
}
}
makeObservableObjectsFromDataSourceTreeItem(dataModel, dataSourceTreeItem);
- //pageDesigner.getAppManager().addDataSource(dataModel);
- Command command = new SetDataSourceCommand(BindingDataSetEventType.DATASOURCE_ADDED, pageDesigner.getAppManager(), dataModel, 0);
+ // pageDesigner.getAppManager().addDataSource(dataModel);
+ Command command =
+ new SetDataSourceCommand(BindingDataSetEventType.DATASOURCE_ADDED,
+ pageDesigner.getAppManager(), dataModel, 0);
getCommandStackFromPageDesigner().execute(command);
}
}
refreshViewModelTree(viewModelTree);
refreshBindingInfos();
refreshActions();
-
+
expandTreeItem();
refreshMenus();
}
}
private void refreshMenus() {
- updateDataSourceMenus();
- updateViewModelMenus();
- updateBindingInfoMenus();
- }
-
- private void expandTreeItem() {
-
- if (pageDesigner == null) {
- return;
- }
-
- List<String> itemPath = pageDesigner.getAppManager().getSelectionPath();
- if ((itemPath == null) || (itemPath.isEmpty())){
- return;
- }
-
- List<String> modelPath = new ArrayList<String>();
- for (int i=0; i<itemPath.size(); i++) {
- modelPath.add(itemPath.get(i));
- }
-
- if ((modelPath != null) && (!modelPath.isEmpty())) {
- TreeItem selectedItem = getSelectedItem(viewModelTree, modelPath);
- if (selectedItem != null) {
- selectedItem.setExpanded(true);
- viewModelTree.setSelection(selectedItem);
- } else {
- selectedItem = getSelectedItem(dataSourceTree, itemPath.get(itemPath.size()-1));
- if (selectedItem != null) {
- selectedItem.setExpanded(true);
- dataSourceTree.setSelection(selectedItem);
- }
- }
- }
- }
-
+ updateDataSourceMenus();
+ updateViewModelMenus();
+ updateBindingInfoMenus();
+ }
+
+ private void expandTreeItem() {
+
+ if (pageDesigner == null) {
+ return;
+ }
+
+ List<String> itemPath = pageDesigner.getAppManager().getSelectionPath();
+ if ((itemPath == null) || (itemPath.isEmpty())) {
+ return;
+ }
+
+ List<String> modelPath = new ArrayList<String>();
+ for (int i = 0; i < itemPath.size(); i++) {
+ modelPath.add(itemPath.get(i));
+ }
+
+ if ((modelPath != null) && (!modelPath.isEmpty())) {
+ TreeItem selectedItem = getSelectedItem(viewModelTree, modelPath);
+ if (selectedItem != null) {
+ selectedItem.setExpanded(true);
+ viewModelTree.setSelection(selectedItem);
+ } else {
+ selectedItem = getSelectedItem(dataSourceTree, itemPath.get(itemPath.size() - 1));
+ if (selectedItem != null) {
+ selectedItem.setExpanded(true);
+ dataSourceTree.setSelection(selectedItem);
+ }
+ }
+ }
+ }
+
private TreeItem getSelectedItem(Tree tree, String name) {
-
- TreeItem[] treeItems = tree.getItems();
- TreeItem selectedItem = null;
- for (TreeItem treeItem : treeItems) {
- if (treeItem.getText().equals(name)) {
- selectedItem = treeItem;
- break;
- }
- }
- return selectedItem;
- }
-
- private TreeItem getSelectedItem(Tree tree, List<String> itemPath) {
- String itemName = itemPath.get(itemPath.size()-1);
- itemPath.remove(itemPath.size()-1);
- TreeItem[] treeItems = tree.getItems();
- TreeItem selectedItem = null;
- for (TreeItem treeItem : treeItems) {
- if (treeItem.getText().equals(itemName)) {
- if (itemPath.isEmpty()) {
- selectedItem = treeItem;
- } else {
- selectedItem = getSelectedItem(treeItem, itemPath);
- }
- break;
- }
- }
- return selectedItem;
- }
-
- private TreeItem getSelectedItem(TreeItem parentTreeItem, List<String> itemPath) {
- if (itemPath.isEmpty()) {
- return parentTreeItem;
- }
- String itemName = itemPath.get(itemPath.size()-1);
- itemPath.remove(itemPath.size()-1);
-
- TreeItem[] treeItems = parentTreeItem.getItems();
- TreeItem selectedItem = null;
-
- for (TreeItem treeItem : treeItems) {
- if (treeItem.getText().equals(itemName)) {
- selectedItem = getSelectedItem(treeItem, itemPath);
- break;
- }
- }
-
- return selectedItem;
- }
-
- private void refreshActions() {
- if (undoHandler != null) {
- ((UpdateAction) undoHandler).update();
- }
- if (redoHandler != null) {
- ((UpdateAction) redoHandler).update();
- }
- }
-
- private void refreshBindingInfos() {
+
+ TreeItem[] treeItems = tree.getItems();
+ TreeItem selectedItem = null;
+ for (TreeItem treeItem : treeItems) {
+ if (treeItem.getText().equals(name)) {
+ selectedItem = treeItem;
+ break;
+ }
+ }
+ return selectedItem;
+ }
+
+ private TreeItem getSelectedItem(Tree tree, List<String> itemPath) {
+ String itemName = itemPath.get(itemPath.size() - 1);
+ itemPath.remove(itemPath.size() - 1);
+ TreeItem[] treeItems = tree.getItems();
+ TreeItem selectedItem = null;
+ for (TreeItem treeItem : treeItems) {
+ if (treeItem.getText().equals(itemName)) {
+ if (itemPath.isEmpty()) {
+ selectedItem = treeItem;
+ } else {
+ selectedItem = getSelectedItem(treeItem, itemPath);
+ }
+ break;
+ }
+ }
+ return selectedItem;
+ }
+
+ private TreeItem getSelectedItem(TreeItem parentTreeItem, List<String> itemPath) {
+ if (itemPath.isEmpty()) {
+ return parentTreeItem;
+ }
+ String itemName = itemPath.get(itemPath.size() - 1);
+ itemPath.remove(itemPath.size() - 1);
+
+ TreeItem[] treeItems = parentTreeItem.getItems();
+ TreeItem selectedItem = null;
+
+ for (TreeItem treeItem : treeItems) {
+ if (treeItem.getText().equals(itemName)) {
+ selectedItem = getSelectedItem(treeItem, itemPath);
+ break;
+ }
+ }
+
+ return selectedItem;
+ }
+
+ private void refreshActions() {
+ if (undoHandler != null) {
+ ((UpdateAction) undoHandler).update();
+ }
+ if (redoHandler != null) {
+ ((UpdateAction) redoHandler).update();
+ }
+ }
+
+ private void refreshBindingInfos() {
if (pageDesigner != null) {
List<PageData> pages = pageDesigner.getAppManager().getPageDataSet().getPages();
for (PageData pageData : pages) {
List<Part> parts = pageData.getPagePart().getChildren();
// parts.get(0).getProperty(BuilderConstants.ATTRIBUTE_DATA_BIND);
- refreshBindingInfo(parts);
+ refreshBindingInfo(parts);
}
}
}
}
for (Part part : parts) {
if (part.getProperty(BuilderConstants.ATTRIBUTE_DATA_BIND) != null) {
- String propertyValue = part.getProperty(BuilderConstants.ATTRIBUTE_DATA_BIND).getValue();
+ String propertyValue =
+ part.getProperty(BuilderConstants.ATTRIBUTE_DATA_BIND).getValue();
if ((propertyValue != null) && (!propertyValue.isEmpty())) {
String[] str = propertyValue.split(": ");
- if (str[1].startsWith(BuilderConstants.DATABINDING_ARRAYITEM_VALUE_PREFIX)) {
- String parentPropertyValue = getParentPropertyValue(part, str[1]);
- if (parentPropertyValue != null) {
- addInfoTableItem(part, parentPropertyValue, part.getIdPropertyValue(), str[0]);
- }
- } else {
- addInfoTableItem(part, str[1], part.getIdPropertyValue(), str[0]);
- }
+ if (str[1].startsWith(BuilderConstants.DATABINDING_ARRAYITEM_VALUE_PREFIX)) {
+ String parentPropertyValue = getParentPropertyValue(part, str[1]);
+ if (parentPropertyValue != null) {
+ addInfoTableItem(part, parentPropertyValue, part.getIdPropertyValue(),
+ str[0]);
+ }
+ } else {
+ addInfoTableItem(part, str[1], part.getIdPropertyValue(), str[0]);
+ }
}
}
refreshBindingInfo(part.getChildren());
}
private String getParentPropertyValue(Part part, String string) {
- Part parentPart = part.getParent();
- String modelName = null;
- if (parentPart == null) {
- return null;
- }
-
- String propertyValue = parentPart.getProperty(BuilderConstants.ATTRIBUTE_DATA_BIND).getValue();
- if ((propertyValue == null) || (propertyValue.isEmpty())) {
- return null;
- }
-
- String[] str = propertyValue.split(": ");
- modelName = str[1] + BuilderConstants.DOT + string.replace(BuilderConstants.DATABINDING_ARRAYITEM_VALUE_PREFIX, "");
-
- return modelName;
- }
-
- private void refreshViewModelTree(Tree viewModelTree) {
+ Part parentPart = part.getParent();
+ String modelName = null;
+ if (parentPart == null) {
+ return null;
+ }
+
+ String propertyValue =
+ parentPart.getProperty(BuilderConstants.ATTRIBUTE_DATA_BIND).getValue();
+ if ((propertyValue == null) || (propertyValue.isEmpty())) {
+ return null;
+ }
+
+ String[] str = propertyValue.split(": ");
+ modelName =
+ str[1] + BuilderConstants.DOT
+ + string.replace(BuilderConstants.DATABINDING_ARRAYITEM_VALUE_PREFIX, "");
+
+ return modelName;
+ }
+
+ private void refreshViewModelTree(Tree viewModelTree) {
if (pageDesigner != null) {
List<BindingData> viewModels = pageDesigner.getAppManager().getViewModels();
if (viewModels == null) {
treeItem.setData("TREEITEMDATA", treeItemData);
if (!viewModel.getDataSourceObjects().isEmpty()) {
- makeSubTreeItem(treeItem, viewModel.getDataSourceObjects());
+ makeSubTreeItem(treeItem, viewModel.getDataSourceObjects());
} else if (!viewModel.getViewModelObjects().isEmpty()) {
- makeSubTreeItem(treeItem, viewModel.getViewModelObjects());
+ makeSubTreeItem(treeItem, viewModel.getViewModelObjects());
}
-
+
TreeItemData data = (TreeItemData) viewModelTree.getData("TREEITEMDATA");
if (data == null) {
data = new TreeItemData();
}
- //data.setViewModelCount(i + 1);
+ // data.setViewModelCount(i + 1);
viewModelTree.setData("TREEITEMDATA", data);
}
}
if (data == null) {
data = new TreeItemData();
}
- //data.setViewModelCount(i + 1);
+ // data.setViewModelCount(i + 1);
dataSourceTree.setData("TREEITEMDATA", data);
}
}
}
}
-
private void updateViewModelToAppManager(Tree tree) {
TreeItem[] treeItems = tree.getItems();
public void addViewModel() {
int idIndex = 0;
while (!canSetTreeItemName(viewModelTree, "model" + idIndex)) {
- idIndex++;
+ idIndex++;
}
-
+
BindingData bindingData = new BindingData();
bindingData.setModelType(BuilderConstants.DATABINDING_TYPE_STATIC);
bindingData.setModelName("model" + idIndex);
-
- Command command = new SetViewModelCommand(BindingDataSetEventType.VIEWMODEL_ADDED, pageDesigner.getAppManager(), bindingData, 0);
+
+ Command command =
+ new SetViewModelCommand(BindingDataSetEventType.VIEWMODEL_ADDED,
+ pageDesigner.getAppManager(), bindingData, 0);
getCommandStackFromPageDesigner().execute(command);
}
-
+
/**
* Adds a tree item in the view model panel.
*
* @return tree item
*/
private List<String> makeItemPath(TreeItem selectedItem) {
- List<String> itemPath = new ArrayList<String>();
-
- TreeItem treeItem = selectedItem;
+ List<String> itemPath = new ArrayList<String>();
+
+ TreeItem treeItem = selectedItem;
itemPath.add(treeItem.getText());
while (treeItem.getParentItem() != null) {
- treeItem = treeItem.getParentItem();
- itemPath.add(treeItem.getText());
+ treeItem = treeItem.getParentItem();
+ itemPath.add(treeItem.getText());
}
return itemPath;
}
-
+
public void addViewModelItem() {
- TreeItem[] selectedItems = viewModelTree.getSelection();
+ TreeItem[] selectedItems = viewModelTree.getSelection();
if (selectedItems.length > 0) {
int idIndex = 0;
while (!canSetTreeItemName(selectedItems[0], "viewModelItem" + idIndex)) {
- idIndex++;
+ idIndex++;
}
- List<String> itemPath = makeItemPath(selectedItems[0]);
- BindingData bindingData = pageDesigner.getAppManager().getViewModel(itemPath.get(itemPath.size()-1));
+ List<String> itemPath = makeItemPath(selectedItems[0]);
+ BindingData bindingData =
+ pageDesigner.getAppManager().getViewModel(itemPath.get(itemPath.size() - 1));
- Command command = new SetViewModelCommand(BindingDataSetEventType.VIEWMODEL_ITEM_ADDED, pageDesigner.getAppManager(), bindingData, itemPath, "viewModelItem"+ idIndex, "",0);
+ Command command =
+ new SetViewModelCommand(BindingDataSetEventType.VIEWMODEL_ITEM_ADDED,
+ pageDesigner.getAppManager(), bindingData, itemPath,
+ "viewModelItem" + idIndex, "", 0);
getCommandStackFromPageDesigner().execute(command);
- }
+ }
}
-
+
/**
* Returns TRUE if tree item name can be set.
- * @param tree
- *
+ *
+ * @param tree
+ *
* @param itemName
* a tree item name
* @return true if tree item name can be set
*/
private boolean canSetTreeItemName(Tree tree, String itemName) {
- TreeItem[] childItems = tree.getItems();
- for (TreeItem childItem : childItems) {
- TreeItemData treeItemData = (TreeItemData) childItem.getData("TREEITEMDATA");
- String originName = null;
- String name;
- if (treeItemData != null) {
- originName = treeItemData.getOriginModelName();
- }
- if (originName == null) {
- name = childItem.getText();
- } else {
- name = originName;
- }
-
- if (name != null) {
- if (name.equals(itemName)) {
- return false;
- }
- }
- }
- return true;
- }
-
+ TreeItem[] childItems = tree.getItems();
+ for (TreeItem childItem : childItems) {
+ TreeItemData treeItemData = (TreeItemData) childItem.getData("TREEITEMDATA");
+ String originName = null;
+ String name;
+ if (treeItemData != null) {
+ originName = treeItemData.getOriginModelName();
+ }
+ if (originName == null) {
+ name = childItem.getText();
+ } else {
+ name = originName;
+ }
+
+ if (name != null) {
+ if (name.equals(itemName)) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
/**
* Returns TRUE if tree item name can be set.
+ *
* @param TreeItem
- *
+ *
* @param itemName
* a tree item name
* @return true if tree item name can be set
*/
private boolean canSetTreeItemName(TreeItem treeItem, String itemName) {
- TreeItem[] childItems = treeItem.getItems();
- for (TreeItem childItem : childItems) {
- if (childItem.getText().equals(itemName)) {
- return false;
- }
- }
- return true;
+ TreeItem[] childItems = treeItem.getItems();
+ for (TreeItem childItem : childItems) {
+ if (childItem.getText().equals(itemName)) {
+ return false;
+ }
+ }
+ return true;
}
/**
*
*/
public void addDataSource() {
- int idIndex = 0;
+ int idIndex = 0;
+
+ while (!canSetTreeItemName(dataSourceTree, "source" + idIndex)) {
+ idIndex++;
+ }
- while (!canSetTreeItemName(dataSourceTree, "source" + idIndex)) {
- idIndex++;
- }
+ BindingData bindingData = new BindingData();
+ bindingData.setModelType(BuilderConstants.DATABINDING_TYPE_STATIC);
+ bindingData.setSourceName("source" + idIndex);
- BindingData bindingData = new BindingData();
- bindingData.setModelType(BuilderConstants.DATABINDING_TYPE_STATIC);
- bindingData.setSourceName("source" + idIndex);
-
- Command command = new SetDataSourceCommand(BindingDataSetEventType.DATASOURCE_ADDED, pageDesigner.getAppManager(), bindingData, 0);
+ Command command =
+ new SetDataSourceCommand(BindingDataSetEventType.DATASOURCE_ADDED,
+ pageDesigner.getAppManager(), bindingData, 0);
getCommandStackFromPageDesigner().execute(command);
}
-
+
public void editDataSource(BindingData dataSource) {
- Command command = new SetDataSourceCommand(BindingDataSetEventType.DATASOURCE_CHANGED, pageDesigner.getAppManager(), dataSource, 0);
+ Command command =
+ new SetDataSourceCommand(BindingDataSetEventType.DATASOURCE_CHANGED,
+ pageDesigner.getAppManager(), dataSource, 0);
getCommandStackFromPageDesigner().execute(command);
- }
-
+ }
+
public void editViewModel(BindingData viewModel) {
- Command command = new SetViewModelCommand(BindingDataSetEventType.VIEWMODEL_CHANGED, pageDesigner.getAppManager(), viewModel, 0);
+ Command command =
+ new SetViewModelCommand(BindingDataSetEventType.VIEWMODEL_CHANGED,
+ pageDesigner.getAppManager(), viewModel, 0);
getCommandStackFromPageDesigner().execute(command);
- }
-
+ }
+
public void setDataSourceToViewModel(BindingData dataSource, BindingData viewModel) {
- BindingData bindingData;
- if (dataSource == null) {
- return;
- }
-
- if (viewModel == null) {
- bindingData = new BindingData();
- int idIndex = 0;
+ BindingData bindingData;
+ if (dataSource == null) {
+ return;
+ }
+
+ if (viewModel == null) {
+ bindingData = new BindingData();
+ int idIndex = 0;
while (!canSetTreeItemName(viewModelTree, "model" + idIndex)) {
- idIndex++;
+ idIndex++;
}
bindingData.setModelName("model" + idIndex);
bindingData.setSourceName(dataSource.getSourceName());
- bindingData.setModelType(dataSource.getModelType());
- bindingData.setUpdateOnStartup(dataSource.getUpdateOnStartup());
- bindingData.addAllHandlerInfos(dataSource.getHandlerInfos());
- bindingData.addAllViewModelObjects(dataSource.getDataSourceObjects());
-
- Command command = new SetViewModelCommand(BindingDataSetEventType.VIEWMODEL_ADDED, pageDesigner.getAppManager(), bindingData, 0);
+ bindingData.setModelType(dataSource.getModelType());
+ bindingData.setUpdateOnStartup(dataSource.getUpdateOnStartup());
+ bindingData.addAllHandlerInfos(dataSource.getHandlerInfos());
+ bindingData.addAllViewModelObjects(dataSource.getDataSourceObjects());
+
+ Command command =
+ new SetViewModelCommand(BindingDataSetEventType.VIEWMODEL_ADDED,
+ pageDesigner.getAppManager(), bindingData, 0);
getCommandStackFromPageDesigner().execute(command);
- } else {
- BindingData oldBindingData = viewModel.clone();
- bindingData = viewModel;
- bindingData.setSourceName(dataSource.getSourceName());
- bindingData.setModelType(dataSource.getModelType());
- bindingData.setUpdateOnStartup(dataSource.getUpdateOnStartup());
- bindingData.addAllHandlerInfos(dataSource.getHandlerInfos());
- bindingData.addAllViewModelObjects(dataSource.getDataSourceObjects());
-
- Command command = new SetViewModelCommand(BindingDataSetEventType.VIEWMODEL_SET_DATASOURCE, pageDesigner.getAppManager(), bindingData, oldBindingData, 0);
+ } else {
+ BindingData oldBindingData = viewModel.clone();
+ bindingData = viewModel;
+ bindingData.setSourceName(dataSource.getSourceName());
+ bindingData.setModelType(dataSource.getModelType());
+ bindingData.setUpdateOnStartup(dataSource.getUpdateOnStartup());
+ bindingData.addAllHandlerInfos(dataSource.getHandlerInfos());
+ bindingData.addAllViewModelObjects(dataSource.getDataSourceObjects());
+
+ Command command =
+ new SetViewModelCommand(BindingDataSetEventType.VIEWMODEL_SET_DATASOURCE,
+ pageDesigner.getAppManager(), bindingData,
+ oldBindingData, 0);
getCommandStackFromPageDesigner().execute(command);
- }
-
- }
+ }
+
+ }
/**
* Removes a tree item in the data source panel.
*/
public void removeDataSource() {
- TreeItem[] treeItems = dataSourceTree.getSelection();
- for (TreeItem treeItem : treeItems) {
- if (treeItem.getParentItem() == null) {
- BindingData bindingData = pageDesigner.getAppManager().getDataSource(treeItem.getText());
- Command command = new SetDataSourceCommand(BindingDataSetEventType.DATASOURCE_REMOVED, pageDesigner.getAppManager(), bindingData, 0);
- getCommandStackFromPageDesigner().execute(command);
- }
- }
- }
-
+ TreeItem[] treeItems = dataSourceTree.getSelection();
+ for (TreeItem treeItem : treeItems) {
+ if (treeItem.getParentItem() == null) {
+ BindingData bindingData =
+ pageDesigner.getAppManager().getDataSource(treeItem.getText());
+ Command command =
+ new SetDataSourceCommand(BindingDataSetEventType.DATASOURCE_REMOVED,
+ pageDesigner.getAppManager(), bindingData, 0);
+ getCommandStackFromPageDesigner().execute(command);
+ }
+ }
+ }
+
public boolean canRemoveDataSource() {
- TreeItem[] treeItems = dataSourceTree.getSelection();
+ TreeItem[] treeItems = dataSourceTree.getSelection();
if ((treeItems == null) || (treeItems.length < 1)) {
- return false;
+ return false;
} else {
- return true;
+ return true;
}
}
-
+
public BindingData getDataSource(String name) {
- return pageDesigner.getAppManager().getDataSource(name);
+ return pageDesigner.getAppManager().getDataSource(name);
}
-
+
public BindingData getViewModel(String name) {
- return pageDesigner.getAppManager().getViewModel(name);
+ return pageDesigner.getAppManager().getViewModel(name);
}
/**
* Removes a tree item in the view model panel.
*/
public void removeViewModel() {
- TreeItem[] treeItems = viewModelTree.getSelection();
+ TreeItem[] treeItems = viewModelTree.getSelection();
for (TreeItem treeItem : treeItems) {
- if (treeItem.getParentItem() == null) {
- BindingData bindingData = pageDesigner.getAppManager().getViewModel(treeItem.getText());
- Command command = new SetViewModelCommand(BindingDataSetEventType.VIEWMODEL_REMOVED, pageDesigner.getAppManager(), bindingData, 0);
- getCommandStackFromPageDesigner().execute(command);
- } else {
- List<String> itemPath = makeItemPath(treeItem);
- BindingData bindingData = pageDesigner.getAppManager().getViewModel(itemPath.get(itemPath.size()-1));
- Command command = new SetViewModelCommand(BindingDataSetEventType.VIEWMODEL_ITEM_REMOVED, pageDesigner.getAppManager(), bindingData, itemPath, treeItem.getText(), "",0);
+ if (treeItem.getParentItem() == null) {
+ BindingData bindingData =
+ pageDesigner.getAppManager().getViewModel(treeItem.getText());
+ Command command =
+ new SetViewModelCommand(BindingDataSetEventType.VIEWMODEL_REMOVED,
+ pageDesigner.getAppManager(), bindingData, 0);
+ getCommandStackFromPageDesigner().execute(command);
+ } else {
+ List<String> itemPath = makeItemPath(treeItem);
+ BindingData bindingData =
+ pageDesigner.getAppManager()
+ .getViewModel(itemPath.get(itemPath.size() - 1));
+ Command command =
+ new SetViewModelCommand(BindingDataSetEventType.VIEWMODEL_ITEM_REMOVED,
+ pageDesigner.getAppManager(), bindingData,
+ itemPath, treeItem.getText(), "", 0);
getCommandStackFromPageDesigner().execute(command);
- }
-
+ }
+
}
}
-
+
public boolean canRemoveViewModel() {
- TreeItem[] treeItems = viewModelTree.getSelection();
+ TreeItem[] treeItems = viewModelTree.getSelection();
if ((treeItems == null) || (treeItems.length < 1)) {
- return false;
+ return false;
} else {
- return true;
+ return true;
}
}
-
+
public void renameViewModel(TreeItem treeItem, String newName) {
- if (treeItem.getParentItem() == null) {
- BindingData bindingData = pageDesigner.getAppManager().getViewModel(treeItem.getText());
- Command command = new SetViewModelCommand(BindingDataSetEventType.VIEWMODEL_RENAMED, pageDesigner.getAppManager(), bindingData, newName, 0);
- getCommandStackFromPageDesigner().execute(command);
- } else {
- List<String> itemPath = makeItemPath(treeItem);
- BindingData bindingData = pageDesigner.getAppManager().getViewModel(itemPath.get(itemPath.size()-1));
- Command command = new SetViewModelCommand(BindingDataSetEventType.VIEWMODEL_ITEM_RENAMED, pageDesigner.getAppManager(), bindingData, itemPath, treeItem.getText(), newName,0);
+ if (treeItem.getParentItem() == null) {
+ BindingData bindingData = pageDesigner.getAppManager().getViewModel(treeItem.getText());
+ Command command =
+ new SetViewModelCommand(BindingDataSetEventType.VIEWMODEL_RENAMED,
+ pageDesigner.getAppManager(), bindingData, newName, 0);
getCommandStackFromPageDesigner().execute(command);
- }
+ } else {
+ List<String> itemPath = makeItemPath(treeItem);
+ BindingData bindingData =
+ pageDesigner.getAppManager().getViewModel(itemPath.get(itemPath.size() - 1));
+ Command command =
+ new SetViewModelCommand(BindingDataSetEventType.VIEWMODEL_ITEM_RENAMED,
+ pageDesigner.getAppManager(), bindingData, itemPath,
+ treeItem.getText(), newName, 0);
+ getCommandStackFromPageDesigner().execute(command);
+ }
}
-
+
public void renameDataSource(TreeItem treeItem, String newName) {
- if (treeItem.getParentItem() == null) {
- BindingData bindingData = pageDesigner.getAppManager().getDataSource(treeItem.getText());
- Command command = new SetDataSourceCommand(BindingDataSetEventType.DATASOURCE_RENAMED, pageDesigner.getAppManager(), bindingData, newName, 0);
- getCommandStackFromPageDesigner().execute(command);
- }
+ if (treeItem.getParentItem() == null) {
+ BindingData bindingData =
+ pageDesigner.getAppManager().getDataSource(treeItem.getText());
+ Command command =
+ new SetDataSourceCommand(BindingDataSetEventType.DATASOURCE_RENAMED,
+ pageDesigner.getAppManager(), bindingData, newName, 0);
+ getCommandStackFromPageDesigner().execute(command);
+ }
}
/**
* @param editor
*/
public void removeInfoTableItem(Part part) {
- if (delegater != null) {
- delegater.valueChanged(part, BuilderConstants.ATTRIBUTE_DATA_BIND, "", true);
+ if (delegater != null) {
+ delegater.valueChanged(part, BuilderConstants.ATTRIBUTE_DATA_BIND, "", true);
}
}
-
/**
* Gets the view model tree.
*
composite.setLayout(new FillLayout());
createActions();
-
+
SashForm sashForm = new SashForm(composite, SWT.HORIZONTAL);
makeDataModelParentPanel(sashForm);
makeBindingInfoPanel(sashForm);
refresh();
}
-
+
@Override
public void dispose() {
- if (pageDesigner != null) {
- pageDesigner.getAppManager().getBindingDataSet().removeBindingDataListener(this);
- }
-
+ if (pageDesigner != null) {
+ pageDesigner.getAppManager().getBindingDataSet().removeBindingDataListener(this);
+ }
+
for (Part pagePart : pageList) {
- removeListeners(pagePart);
+ removeListeners(pagePart);
}
pageList.clear();
super.dispose();
private void makeBindingInfoPanel(SashForm sashForm) {
Composite dataInfoPanel = new Composite(sashForm, SWT.BORDER);
- //dataInfoPanel.setLayout(new FillLayout(SWT.VERTICAL));
+ // dataInfoPanel.setLayout(new FillLayout(SWT.VERTICAL));
FormLayout layout = new FormLayout();
dataInfoPanel.setLayout(layout);
toolBarData.top = new FormAttachment(0, 0);
toolBarData.right = new FormAttachment(100, 0);
toolBar.setLayoutData(toolBarData);
-
+
infoTableViewer = new TableViewer(dataInfoPanel, SWT.NONE);
FormData tableData = new FormData();
tableData.top = new FormAttachment(toolBar, 0);
infoTableViewer.getTable().setHeaderVisible(true);
infoTableViewer.getTable().setLinesVisible(true);
-
+
infoTableViewer.getTable().addKeyListener(new KeyAdapter() {
- public void keyPressed(KeyEvent event) {
- switch (event.keyCode) {
- case SWT.DEL:
- removeBindingInfo();
- break;
- }
- }
+ public void keyPressed(KeyEvent event) {
+ switch (event.keyCode) {
+ case SWT.DEL:
+ removeBindingInfo();
+ break;
+ }
+ }
});
infoTableViewer.getTable().addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateBindingInfoMenus();
- }
+ public void widgetSelected(SelectionEvent e) {
+ updateBindingInfoMenus();
+ }
});
-
+
makeBindingInfoContextMenu();
}
-
+
+ public void showDataBindingInfo(boolean show) {
+ // if (delegater != null) {
+ // delegater.showDataBindInfo(show);
+ // }
+ if (null != pageDesigner) {
+ pageDesigner.showBindingInfo(show);
+ }
+ }
+
public void removeBindingInfo() {
- TableItem[] tableItems = infoTableViewer.getTable().getSelection();
- for (TableItem tableItem : tableItems) {
- Part part = (Part) tableItem.getData("PART");
- if (part != null) {
- removeInfoTableItem(part);
- }
- }
- }
-
+ TableItem[] tableItems = infoTableViewer.getTable().getSelection();
+ for (TableItem tableItem : tableItems) {
+ Part part = (Part) tableItem.getData("PART");
+ if (part != null) {
+ removeInfoTableItem(part);
+ }
+ }
+ }
+
public boolean canRemoveBindingInfo() {
- TableItem[] tableItems = infoTableViewer.getTable().getSelection();
- if ((tableItems == null) || (tableItems.length < 1)) {
- return false;
+ TableItem[] tableItems = infoTableViewer.getTable().getSelection();
+ if ((tableItems == null) || (tableItems.length < 1)) {
+ return false;
} else {
- return true;
- }
+ return true;
+ }
}
private void makeDataModelParentPanel(SashForm parentSashForm) {
treeData.left = new FormAttachment(0, 0);
treeData.right = new FormAttachment(100, 0);
dataSourceTree.setLayoutData(treeData);
-
+
dataSourceTreeEditor = new TreeEditor(dataSourceTree);
dataSourceTreeEditor.horizontalAlignment = SWT.LEFT;
dataSourceTreeEditor.grabHorizontal = true;
Rectangle rect = treeItem.getBounds();
if (rect.contains(point)) {
- renameDataSource(treeItem);
+ renameDataSource(treeItem);
}
}
// Make sure one and only one item is selected when F2 is
// pressed
if (event.keyCode == SWT.F2 && dataSourceTree.getSelectionCount() == 1) {
- renameDataSource(null);
+ renameDataSource(null);
} else if (event.keyCode == SWT.DEL) {
- removeViewModel();
+ removeViewModel();
}
}
});
-
+
dataSourceTree.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateDataSourceMenus();
- }
+ public void widgetSelected(SelectionEvent e) {
+ updateDataSourceMenus();
+ }
});
-
+
dataSourceTree.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent event) {
- if (event.keyCode == SWT.DEL) {
- removeDataSource();
+ if (event.keyCode == SWT.DEL) {
+ removeDataSource();
}
}
});
// DataBindingDnDManager.addDragAndDropListenerToTree(dataSourceTree);
DataBindingDnDManager.addDragListenerToDataSourceTree(dataSourceTree);
makeDataSourceContextMenu();
- }
-
+ }
+
public void renameDataSource(TreeItem treeItem) {
- renameTreeItem(dataSourceTree, dataSourceTreeEditor, treeItem);
+ renameTreeItem(dataSourceTree, dataSourceTreeEditor, treeItem);
}
private ToolBar makeDataSourcePanelToolbar(Composite panel) {
return toolBar;
}
-
+
private void makeDataSourceContextMenu() {
- dataSourceMenuManager = new MenuManager("#dataSourceMenu");
- dataSourceMenuManager.add(editDataModelAction);
- dataSourceMenuManager.add(removeDataSourceAction);
- dataSourceMenuManager.add(addDataSourceAction);
- dataSourceMenuManager.add(renameDataSourceAction);
- dataSourceMenuManager.update(true);
-
- Menu menu = dataSourceMenuManager.createContextMenu(dataSourceTree);
+ dataSourceMenuManager = new MenuManager("#dataSourceMenu");
+ dataSourceMenuManager.add(editDataModelAction);
+ dataSourceMenuManager.add(removeDataSourceAction);
+ dataSourceMenuManager.add(addDataSourceAction);
+ dataSourceMenuManager.add(renameDataSourceAction);
+ dataSourceMenuManager.update(true);
+
+ Menu menu = dataSourceMenuManager.createContextMenu(dataSourceTree);
dataSourceTree.setMenu(menu);
}
return toolBar;
}
-
+
private void makeViewModelContextMenu() {
- viewModelMenuManager = new MenuManager("#viewModelMenu");
- viewModelMenuManager.add(setTargetAction);
- viewModelMenuManager.add(getSourceAction);
- viewModelMenuManager.add(removeViewModelAction);
- viewModelMenuManager.add(addViewModelItemAction);
- viewModelMenuManager.add(addViewModelAction);
- viewModelMenuManager.add(renameViewModelAction);
- viewModelMenuManager.update(true);
-
- Menu menu = viewModelMenuManager.createContextMenu(viewModelTree);
- viewModelTree.setMenu(menu);
- }
-
+ viewModelMenuManager = new MenuManager("#viewModelMenu");
+ viewModelMenuManager.add(setTargetAction);
+ viewModelMenuManager.add(getSourceAction);
+ viewModelMenuManager.add(removeViewModelAction);
+ viewModelMenuManager.add(addViewModelItemAction);
+ viewModelMenuManager.add(addViewModelAction);
+ viewModelMenuManager.add(renameViewModelAction);
+ viewModelMenuManager.update(true);
+
+ Menu menu = viewModelMenuManager.createContextMenu(viewModelTree);
+ viewModelTree.setMenu(menu);
+ }
+
private ToolBar makeBindingInfoToolbar(Composite panel) {
ToolBar toolBar = new ToolBar(panel, SWT.FLAT);
bindingInfoToolBarManager = new ToolBarManager(toolBar);
+ Image img = ResourceManager.getImage(BuilderConstants.ICON_DIR, "show_bind.gif");
+ ImageDescriptor imgDesc = ImageDescriptor.createFromImage(img);
+ Action showBindingInfo = new Action("show data binding info", imgDesc) {
+
+ public void run() {
+ showBindInfo = !showBindInfo;
+ pageDesigner.showBindingInfo(showBindInfo);
+ Image img = null;
+ if (showBindInfo) {
+ img = ResourceManager.getImage(BuilderConstants.ICON_DIR, "hide_bind.gif");
+ } else {
+ img = ResourceManager.getImage(BuilderConstants.ICON_DIR, "show_bind.gif");
+ }
+ ImageDescriptor imgDesc = ImageDescriptor.createFromImage(img);
+ setImageDescriptor(imgDesc);
+ }
+
+ };
+
+ bindingInfoToolBarManager.add(showBindingInfo);
+ bindingInfoToolBarManager.add(new Separator());
bindingInfoToolBarManager.add(removeBindingInfoAction);
+
bindingInfoToolBarManager.update(true);
return toolBar;
}
-
+
private void makeBindingInfoContextMenu() {
- bindingInfoMenuManager = new MenuManager("#BindingInfoMenu");
-
- bindingInfoMenuManager.add(removeBindingInfoAction);
- bindingInfoMenuManager.update(true);
-
- Menu menu = bindingInfoMenuManager.createContextMenu(infoTableViewer.getTable());
- infoTableViewer.getTable().setMenu(menu);
+ bindingInfoMenuManager = new MenuManager("#BindingInfoMenu");
+
+ bindingInfoMenuManager.add(removeBindingInfoAction);
+ bindingInfoMenuManager.update(true);
+
+ Menu menu = bindingInfoMenuManager.createContextMenu(infoTableViewer.getTable());
+ infoTableViewer.getTable().setMenu(menu);
}
private void makeDataViewModelPanel(SashForm sashForm) {
Rectangle rect = treeItem.getBounds();
if (rect.contains(point)) {
- renameViewModel(treeItem);
+ renameViewModel(treeItem);
}
}
// Make sure one and only one item is selected when F2 is
// pressed
if (event.keyCode == SWT.F2 && viewModelTree.getSelectionCount() == 1) {
- renameViewModel(null);
+ renameViewModel(null);
} else if (event.keyCode == SWT.DEL) {
- removeViewModel();
+ removeViewModel();
}
}
});
-
+
viewModelTree.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- updateViewModelMenus();
- }
+ public void widgetSelected(SelectionEvent e) {
+ updateViewModelMenus();
+ }
});
DataBindingDnDManager.addDragAndDropListenerToViewModelTree(viewModelTree, dataBindingView,
// DataBindingDnDManager.addDropListenerToViewModelTree(viewModelTree);
makeViewModelContextMenu();
}
-
+
public void renameViewModel(TreeItem treeItem) {
- renameTreeItem(viewModelTree, viewModelTreeEditor, treeItem);
+ renameTreeItem(viewModelTree, viewModelTreeEditor, treeItem);
}
-
+
private void renameTreeItem(final Tree tree, TreeEditor treeEditor, TreeItem treeItem) {
- // Determine the item to edit
- final TreeItem item;
- if (treeItem == null) {
- item = tree.getSelection()[0];
- } else {
- item = treeItem;
- }
- if (treeEditor == null) {
- return;
- }
+ // Determine the item to edit
+ final TreeItem item;
+ if (treeItem == null) {
+ item = tree.getSelection()[0];
+ } else {
+ item = treeItem;
+ }
+ if (treeEditor == null) {
+ return;
+ }
Control oldEditor = treeEditor.getEditor();
if (oldEditor != null) {
// and end the editing session
text.addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent event) {
- if (tree.equals(getDataSourceTree())) {
- renameDataSource(item, text.getText());
- } else {
- renameViewModel(item, text.getText());
- }
+ if (tree.equals(getDataSourceTree())) {
+ renameDataSource(item, text.getText());
+ } else {
+ renameViewModel(item, text.getText());
+ }
text.dispose();
}
});
case SWT.CR:
// Enter hit--set the text into the tree and
// drop through
- if (tree.equals(getDataSourceTree())) {
- renameDataSource(item, text.getText());
- } else {
- renameViewModel(item, text.getText());
- }
+ if (tree.equals(getDataSourceTree())) {
+ renameDataSource(item, text.getText());
+ } else {
+ renameViewModel(item, text.getText());
+ }
text.dispose();
break;
case SWT.KEYPAD_CR:
- if (tree.equals(getDataSourceTree())) {
- renameDataSource(item, text.getText());
- } else {
- renameViewModel(item, text.getText());
- }
+ if (tree.equals(getDataSourceTree())) {
+ renameDataSource(item, text.getText());
+ } else {
+ renameViewModel(item, text.getText());
+ }
text.dispose();
break;
case SWT.ESC:
return null;
}
}
-
+
private ActionRegistry getActionRegistryFromPageDesigner() {
if (pageDesigner != null) {
return (ActionRegistry) pageDesigner.getAdapter(ActionRegistry.class);
public void setInput(PageDesigner pageDesigner) {
this.pageDesigner = pageDesigner;
this.delegater = new DataBindingEventDelegater(getCommandStackFromPageDesigner(), this);
-
+
if (getActionRegistryFromPageDesigner() != null) {
- this.undoHandler = getActionRegistryFromPageDesigner().getAction(ActionFactory.UNDO.getId());
- this.redoHandler = getActionRegistryFromPageDesigner().getAction(ActionFactory.REDO.getId());
+ this.undoHandler =
+ getActionRegistryFromPageDesigner().getAction(ActionFactory.UNDO.getId());
+ this.redoHandler =
+ getActionRegistryFromPageDesigner().getAction(ActionFactory.REDO.getId());
}
-
+
pageDesigner.getAppManager().getBindingDataSet().addBindingDataListener(this);
-
+
}
public PageDesigner getInput() {
return this.pageDesigner;
}
- public void selectionChanged(IWorkbenchPart part, ISelection selection) {
- if (selection instanceof StructuredSelection && !selection.isEmpty()) {
+ public void selectionChanged(IWorkbenchPart part, ISelection selection) {
+ if (selection instanceof StructuredSelection && !selection.isEmpty()) {
StructuredSelection ssel = (StructuredSelection) selection;
if (part instanceof PageDesigner || part instanceof ContentOutline) {
if (editPart.getModel() instanceof Part) {
Part model = (Part) editPart.getModel();
selModels.add(model);
- }
+ }
}
}
-
+
if (selModels.get(0).getOwnerPage() != null) {
- if (!pageList.contains(selModels.get(0).getOwnerPage())) {
- pageList.add(selModels.get(0).getOwnerPage());
- addListeners(selModels.get(0).getOwnerPage());
- }
+ if (!pageList.contains(selModels.get(0).getOwnerPage())) {
+ pageList.add(selModels.get(0).getOwnerPage());
+ addListeners(selModels.get(0).getOwnerPage());
+ }
}
}
}
- }
-
- public void updateDataSourceMenus() {
- if (removeDataSourceAction != null) {
- removeDataSourceAction.refresh();
- }
- if (editDataModelAction != null) {
- editDataModelAction.refresh();
- }
- if (renameDataSourceAction != null) {
- renameDataSourceAction.refresh();
- }
- if (dataSourceToolBarManager != null) {
- dataSourceToolBarManager.update(true);
- }
- if (dataSourceMenuManager != null) {
- dataSourceMenuManager.update(true);
- }
- }
-
- public void updateViewModelMenus() {
- if (addViewModelItemAction != null) {
- addViewModelItemAction.refresh();
- }
- if (removeViewModelAction != null) {
- removeViewModelAction.refresh();
- }
- if (setTargetAction != null) {
- setTargetAction.refresh();
- }
- if (getSourceAction != null) {
- getSourceAction.refresh();
- }
- if (renameViewModelAction != null) {
- renameViewModelAction.refresh();
- }
- if (viewModelToolBarManager != null) {
- viewModelToolBarManager.update(true);
- }
- if (viewModelMenuManager != null) {
- viewModelMenuManager.update(true);
- }
- }
-
- public void updateBindingInfoMenus() {
- if (removeBindingInfoAction != null) {
- removeBindingInfoAction.refresh();
- }
- if (bindingInfoToolBarManager != null) {
- bindingInfoToolBarManager.update(true);
- }
- if (bindingInfoMenuManager != null) {
- bindingInfoMenuManager.update(true);
- }
- }
-
- @Override
+ }
+
+ public void updateDataSourceMenus() {
+ if (removeDataSourceAction != null) {
+ removeDataSourceAction.refresh();
+ }
+ if (editDataModelAction != null) {
+ editDataModelAction.refresh();
+ }
+ if (renameDataSourceAction != null) {
+ renameDataSourceAction.refresh();
+ }
+ if (dataSourceToolBarManager != null) {
+ dataSourceToolBarManager.update(true);
+ }
+ if (dataSourceMenuManager != null) {
+ dataSourceMenuManager.update(true);
+ }
+ }
+
+ public void updateViewModelMenus() {
+ if (addViewModelItemAction != null) {
+ addViewModelItemAction.refresh();
+ }
+ if (removeViewModelAction != null) {
+ removeViewModelAction.refresh();
+ }
+ if (setTargetAction != null) {
+ setTargetAction.refresh();
+ }
+ if (getSourceAction != null) {
+ getSourceAction.refresh();
+ }
+ if (renameViewModelAction != null) {
+ renameViewModelAction.refresh();
+ }
+ if (viewModelToolBarManager != null) {
+ viewModelToolBarManager.update(true);
+ }
+ if (viewModelMenuManager != null) {
+ viewModelMenuManager.update(true);
+ }
+ }
+
+ public void updateBindingInfoMenus() {
+ if (removeBindingInfoAction != null) {
+ removeBindingInfoAction.refresh();
+ }
+ if (bindingInfoToolBarManager != null) {
+ bindingInfoToolBarManager.update(true);
+ }
+ if (bindingInfoMenuManager != null) {
+ bindingInfoMenuManager.update(true);
+ }
+ }
+
+ public boolean isShowBindInfo() {
+ return showBindInfo;
+ }
+
+ @Override
public void setActionBars(IActionBars actionBars) {
// register global action handlers for undo and redo
actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undoHandler);
actionBars.updateActionBars();
}
- @Override
- public void allDataSourcesReseted(BindingDataSetEvent e) {
- refresh();
- }
-
- @Override
- public void dataSourceAdded(BindingDataSetEvent e) {
- refresh();
- }
-
- @Override
- public void dataSourceRemoved(BindingDataSetEvent e) {
- refresh();
- }
-
- @Override
- public void dataSourceRenamed(BindingDataSetEvent e) {
- refresh();
- }
-
- @Override
- public void dataSourceMoved(BindingDataSetEvent e) {
- refresh();
- }
-
- @Override
- public void allViewModelReseted(BindingDataSetEvent e) {
- refresh();
- }
-
- @Override
- public void viewModelAdded(BindingDataSetEvent e) {
- refresh();
- }
-
- @Override
- public void viewModelRemoved(BindingDataSetEvent e) {
- refresh();
- }
-
- @Override
- public void viewModelRenamed(BindingDataSetEvent e) {
- refresh();
- }
-
- @Override
- public void viewModelMoved(BindingDataSetEvent e) {
- refresh();
- }
-
- @Override
- public void viewModelChanged(BindingDataSetEvent e) {
- refresh();
- }
-
+ @Override
+ public void allDataSourcesReseted(BindingDataSetEvent e) {
+ refresh();
+ }
+
+ @Override
+ public void dataSourceAdded(BindingDataSetEvent e) {
+ refresh();
+ }
+
+ @Override
+ public void dataSourceRemoved(BindingDataSetEvent e) {
+ refresh();
+ }
+
+ @Override
+ public void dataSourceRenamed(BindingDataSetEvent e) {
+ refresh();
+ }
+
+ @Override
+ public void dataSourceMoved(BindingDataSetEvent e) {
+ refresh();
+ }
+
+ @Override
+ public void allViewModelReseted(BindingDataSetEvent e) {
+ refresh();
+ }
+
+ @Override
+ public void viewModelAdded(BindingDataSetEvent e) {
+ refresh();
+ }
+
+ @Override
+ public void viewModelRemoved(BindingDataSetEvent e) {
+ refresh();
+ }
+
+ @Override
+ public void viewModelRenamed(BindingDataSetEvent e) {
+ refresh();
+ }
+
+ @Override
+ public void viewModelMoved(BindingDataSetEvent e) {
+ refresh();
+ }
+
+ @Override
+ public void viewModelChanged(BindingDataSetEvent e) {
+ refresh();
+ }
+
}