org.eclipse.ui.navigator,
org.tizen.common,
org.tizen.web.project.wizard;bundle-version="1.0.0",
- org.eclipse.jst.pagedesigner,
org.eclipse.ui.views.properties.tabbed,
org.eclipse.ltk.core.refactoring;bundle-version="3.5.201",
org.eclipse.wst.jsdt.ui,
<property name="size" type="html.heading@size" displayName="Size" default="3">
<condition name="disable-property-by-parent" value="tizen.header"/>
</property> -->
+
+ <property name="data-bind" type="text@databinding" displayName="Data Binding" default="text" initValue=""/>
<event name="ontap" displayName="Tap" eventType="event.defaultevent" />
<event name="ontaphold" displayName="TapHold" eventType="event.defaultevent" />
<!-- <property name="data-shadow" type="boolean" displayName="Shadow" default="true"/>
<property name="data-mini" type="boolean" displayName="Mini" default="false"/> -->
+
+ <property name="data-bind" type="text@databinding" displayName="Data Binding" default="" initValue=""/>
<event name="ontap" displayName="Tap" eventType="event.defaultevent" />
<event name="ontaphold" displayName="TapHold" eventType="event.defaultevent" />
<property name="data-inset" type="boolean" displayName="Inset" default="false"/> -->
<property name="data-autodividers" type="tizen@boolean2" displayName="Auto Dividers" default=""/>
<property name="data-fastscroll" type="tizen@boolean2" displayName="Fast Scroll" default=""/>
+
+ <property name="data-bind" type="foreach@databinding" displayName="Data Binding" default="" initValue=""/>
<event name="ontap" displayName="Tap" eventType="event.defaultevent" />
<event name="ontaphold" displayName="TapHold" eventType="event.defaultevent" />
<condition name="enable-property-by-child" value="tizen.listitemsubtexticon"/>
</property> -->
+ <property name="data-bind" type="text@databinding" displayName="Data Binding" default="" initValue=""/>
+
<!-- <event name="ontap" displayName="Tap" eventType="event.defaultevent" />
<event name="ontaphold" displayName="TapHold" eventType="event.defaultevent" />
<event name="onswipe" displayName="Swipe" eventType="event.defaultevent" />
<property name="border-color" type="css-color" displayName="Color" selector="#%id%"/>
<property name="border-style" type="border@style" displayName="Style" selector="#%id%"/>
</property> -->
+
+ <property name="data-bind" type="attr@databinding" displayName="Data Binding" default="" initValue=""/>
<event name="ontap" displayName="Tap" eventType="event.defaultevent" />
<event name="ontaphold" displayName="TapHold" eventType="event.defaultevent" />
protected String description;
/**
+ * The condition of feedback in Page Designer.
+ */
+ protected String layoutCapacity;
+
+ /**
* The visibility in a palette of Page Designer.
*/
protected boolean paletteVisible;
* a 16x16 icon name
* @param description
* a description of {@link Part}
+ * @param layoutCapacity
+ * a layoutCapacity of {@link Part}
* @param paletteVisible
* the visibility in a palette of Page Designer
* @param helpCategory
* a child xpath
*/
public void init(String descriptorId, String displayName, String smallIcon, String icon16,
- String description, boolean paletteVisible, String helpCategory,
+ String description, String layoutCapacity, boolean paletteVisible, String helpCategory,
String helpContens, String feedbackWidth, String feedbackHeight,
boolean borderVisible, String feedbackCondition, String guideText,
boolean setStyle, String uiSelector, String xpath, String childXpath) {
this.smallIcon = smallIcon;
this.icon16 = icon16;
this.description = description;
+ this.layoutCapacity = layoutCapacity;
this.paletteVisible = paletteVisible;
this.helpCategory = helpCategory;
this.helpContents = helpContens;
}
/**
+ * Gets a layoutCapacity of {@link Part}.
+ *
+ * @return layoutCapacity of {@link Part}
+ */
+ public String getLayoutCapacity() {
+ return layoutCapacity;
+ }
+
+ /**
* Gets the visibility in a palette of Page Designer.
*
* @return visibility in a palette of Page Designer
private static final String ATTR_ICON = "icon"; //$NON-NLS-1$
private static final String ATTR_CATEGORY = "category"; //$NON-NLS-1$
private static final String ATTR_DESCRIPTION = "description"; //$NON-NLS-1$
+ private static final String ATTR_LAYOUT_CAPACITY = "layoutCapacity"; //$NON-NLS-1$
private static final String ATTR_PALETTE_VISIBLE = "paletteVisible"; //$NON-NLS-1$
private static final String ATTR_HELPCATEGORY = "helpCategory"; //$NON-NLS-1$
private static final String ATTR_HELPCONTENS = "helpContents"; //$NON-NLS-1$
String smallIcon = elem.getAttribute(ATTR_SMALLICON);
String icon16 = elem.getAttribute(ATTR_ICON_16);
String description = elem.getAttribute(ATTR_DESCRIPTION);
+ String layoutCapacity = elem.getAttribute(ATTR_LAYOUT_CAPACITY);
String paletteVisible = elem.getAttribute(ATTR_PALETTE_VISIBLE);
String helpCategory = elem.getAttribute(ATTR_HELPCATEGORY);
String helpContens = elem.getAttribute(ATTR_HELPCONTENS);
boolean boolBorderVisible = Boolean.parseBoolean(borderVisible);
boolean boolSetStyle = Boolean.parseBoolean(setStyle);
- part.init(id, displayName, smallIcon, icon16, description,
+ part.init(id, displayName, smallIcon, icon16, description, layoutCapacity,
boolpaletteVisible, helpCategory, helpContens, width, height,
boolBorderVisible, feedbackCondition, guideText, boolSetStyle,
uiSelector, xpath, childXpath);
TreeItemData treeData = new TreeItemData();
TreeItemData treeItemData = new TreeItemData();
- int count = 0;
- TreeItemData viewModelTreeData =
- (TreeItemData) viewModelTree.getData("TREEITEMDATA");
- if (viewModelTreeData != null) {
- count = viewModelTreeData.getViewModelCount();
+ int idIndex = 0;
+
+ while (!canSetTreeItemName(viewModelTree, "model" + idIndex)) {
+ idIndex++;
}
+ viewModelItem.setText("model" + idIndex);
- viewModelItem.setText("model" + count++);
- treeData.setViewModelCount(count);
treeItemData.setOriginModelName(viewModelItem.getText());
viewModelItem.setData("TREEITEMDATA", treeItemData);
viewModelTree.setData("TREEITEMDATA", treeData);
}
});
}
+
+ /**
+ * Returns TRUE if tree item name can be set.
+ * @param viewModelTree
+ *
+ * @param itemName
+ * a tree item name
+ * @return true if tree item name can be set
+ */
+ private static boolean canSetTreeItemName(Tree tree, String itemName) {
+ TreeItem[] childItems = tree.getItems();
+ for (TreeItem childItem : childItems) {
+ TreeItemData treeItemData = (TreeItemData) childItem.getData("TREEITEMDATA");
+ if ((treeItemData != null) && (treeItemData.getOriginModelName().equals(itemName))) {
+ return false;
+ }
+ }
+ return true;
+ }
private static void makeViewModel(TreeItem item, TreeItem sourceItem) {
TreeItemData treeItemData = (TreeItemData) item.getData("TREEITEMDATA");
import org.tizen.webuibuilder.ui.editor.PageDesigner;
import org.tizen.webuibuilder.ui.views.databinding.actions.AddDataSourceAction;
import org.tizen.webuibuilder.ui.views.databinding.actions.AddViewModelAction;
+import org.tizen.webuibuilder.ui.views.databinding.actions.AddViewModelItemAction;
import org.tizen.webuibuilder.ui.views.databinding.actions.EditDataSourceAction;
import org.tizen.webuibuilder.ui.views.databinding.actions.GetSourceAction;
import org.tizen.webuibuilder.ui.views.databinding.actions.RemoveDataSourceAction;
private DataBindingView dataBindingView;
private AddViewModelAction addViewModelAction;
+ private AddViewModelItemAction addViewModelItemAction;
private EditDataSourceAction editDataModelAction;
private SetTargetAction setTargetAction;
private GetSourceAction getSourceAction;
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);
}
}
TreeItem[] subSubTreeItems = item.getItems();
for (TreeItem subItem : subSubTreeItems) {
- makeObservableObjectsFromTreeItem2(observableObject, subItem);
+ makeObservableObjectsFromSubTreeItem(observableObject, subItem);
}
}
}
- // FIXME change the func name...
- private void makeObservableObjectsFromTreeItem2(BindingObject parent, TreeItem treeItem) {
+ private void makeObservableObjectsFromSubTreeItem(BindingObject parent, TreeItem treeItem) {
TreeItem[] subTreeItems = treeItem.getItems();
TreeItemData treeItemData = (TreeItemData) treeItem.getData("TREEITEMDATA");
String type = null;
parent.add(observableObject);
for (TreeItem item : subTreeItems) {
- makeObservableObjectsFromTreeItem2(observableObject, item);
+ makeObservableObjectsFromSubTreeItem(observableObject, item);
}
/*
*/
public TreeItem addViewModel() {
- TreeItem[] selectedItems = viewModelTree.getSelection();
+ TreeItem item = new TreeItem(viewModelTree, 0);
+ TreeItemData treeItemData = new TreeItemData();
+ TreeItemData modelTreeItemData = (TreeItemData) viewModelTree.getData("TREEITEMDATA");
- if (selectedItems.length == 0) {
- TreeItem item = new TreeItem(viewModelTree, 0);
- TreeItemData treeItemData = new TreeItemData();
- TreeItemData modelTreeItemData = (TreeItemData) viewModelTree.getData("TREEITEMDATA");
+ int idIndex = 0;
- int count = 0;
- if (modelTreeItemData != null) {
- count = modelTreeItemData.getViewModelCount();
- }
+ while (!canSetTreeItemName(viewModelTree, "model" + idIndex)) {
+ idIndex++;
+ }
- item.setText("model" + count++);
- if (modelTreeItemData == null) {
- modelTreeItemData = new TreeItemData();
- }
+ item.setText("model" + idIndex);
+ if (modelTreeItemData == null) {
+ modelTreeItemData = new TreeItemData();
+ }
- modelTreeItemData.setViewModelCount(count);
- viewModelTree.setData("TREEITEMDATA", modelTreeItemData);
+ viewModelTree.setData("TREEITEMDATA", modelTreeItemData);
- treeItemData.setOriginModelName(item.getText());
+ treeItemData.setOriginModelName(item.getText());
- BindingData bindingData = new BindingData();
- bindingData.setModelType("STATIC");
- treeItemData.setModel(bindingData);
- item.setData("TREEITEMDATA", treeItemData);
- viewModelTree.select(item);
- return item;
- } else {
+ BindingData bindingData = new BindingData();
+ bindingData.setModelType("STATIC");
+ treeItemData.setModel(bindingData);
+ item.setData("TREEITEMDATA", treeItemData);
+ viewModelTree.select(item);
+ return item;
+
+ }
+
+ /**
+ * Adds a tree item in the view model panel.
+ *
+ * @return tree item
+ */
+ public TreeItem addViewModelItem() {
+
+ TreeItem[] selectedItems = viewModelTree.getSelection();
+
+ if (selectedItems.length != 0) {
TreeItem item = new TreeItem(selectedItems[0], 0);
- item.setText("viewModelItem");
+ int idIndex = 0;
+
+ while (!canSetTreeItemName(selectedItems[0], "viewModelItem" + idIndex)) {
+ idIndex++;
+ }
+
+ TreeItem parentItem = selectedItems[0];
+ if (parentItem != null) {
+ TreeItemData treeItemData = (TreeItemData) parentItem.getData("TREEITEMDATA");
+ if (treeItemData != null) {
+ if (treeItemData.getObjectType() == null) {
+ treeItemData.setObjectType("JSONObject");
+ parentItem.setData("TREEITEMDATA", treeItemData);
+ } else {
+ //do nothing
+ }
+
+ } else {
+ treeItemData = new TreeItemData();
+ treeItemData.setObjectType("JSONObject");
+ parentItem.setData("TREEITEMDATA", treeItemData);
+ }
+ }
+
+ item.setText("viewModelItem"+ idIndex);
viewModelTree.showItem(item);
return item;
+ } else {
+ return null;
}
}
+
+ /**
+ * Returns TRUE if tree item name can be set.
+ * @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;
+ }
+
+ /**
+ * 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;
+ }
/**
* Adds a tree item in the data source panel.
TreeItemData treeItemData = new TreeItemData();
TreeItemData sourceTreeItemData = (TreeItemData) dataSourceTree.getData("TREEITEMDATA");
- int count = 0;
- if (sourceTreeItemData != null) {
- count = sourceTreeItemData.getViewModelCount();
+ int idIndex = 0;
+
+ while (!canSetTreeItemName(dataSourceTree, "source" + idIndex)) {
+ idIndex++;
}
- item.setText("source" + count++);
+ item.setText("source" + idIndex);
if (sourceTreeItemData == null) {
sourceTreeItemData = new TreeItemData();
}
- sourceTreeItemData.setViewModelCount(count);
+
dataSourceTree.setData("TREEITEMDATA", sourceTreeItemData);
BindingData bindingData = new BindingData();
private void removeSelectedTreeItem(Tree tree) {
TreeItem[] treeItems = tree.getSelection();
for (TreeItem treeItem : treeItems) {
+ if (treeItem.getParentItem() != null) {
+ if (treeItem.getParentItem().getItems().length == 1) {
+ TreeItemData treeItemData = (TreeItemData)treeItem.getParentItem().getData("TREEITEMDATA");
+
+ if (treeItemData != null) {
+ treeItemData.setObjectType(null);
+ treeItem.getParentItem().setData("TREEITEMDATA", treeItemData);
+ }
+ }
+ }
treeItem.dispose();
}
}
private void createActions() {
editDataModelAction = new EditDataSourceAction("EDIT", dataBindingView);
addViewModelAction = new AddViewModelAction("ADD", dataBindingView);
+ addViewModelItemAction = new AddViewModelItemAction("ADD ITEM", dataBindingView);
setTargetAction = new SetTargetAction("SET TARGET", dataBindingView);
getSourceAction = new GetSourceAction("GET SOURCE", dataBindingView);
toolBarManager.add(setTargetAction);
toolBarManager.add(getSourceAction);
toolBarManager.add(removeViewModelAction);
+ toolBarManager.add(addViewModelItemAction);
toolBarManager.add(addViewModelAction);
toolBarManager.update(true);
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.custom.StackLayout;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.custom.TreeEditor;
}
});
- settingComposite = makeSettingComposite(treeGroup, addTreeItemButton);
- treeComposite = makeTreeComposite(treeGroup, settingComposite, addTreeItemButton);
+ SashForm sashForm = makeSashForm(treeGroup, addTreeItemButton);
+ settingComposite = makeSettingComposite(sashForm, addTreeItemButton);
+ treeComposite = makeTreeComposite(sashForm, settingComposite, addTreeItemButton);
+ sashForm.setWeights(new int[] {2, 3});
return treeGroup;
}
return dialogTree;
}
- private Composite makeTreeComposite(Group treeGroup, Composite settingComposite,
+ private SashForm makeSashForm(Group treeGroup, Button addButton) {
+ SashForm sashForm = new SashForm(treeGroup, SWT.HORIZONTAL);
+
+ FormData data = new FormData();
+ data.top = new FormAttachment(addButton, 0, SWT.TOP);
+ data.bottom = new FormAttachment(100, 0);
+ data.left = new FormAttachment(0, 0);
+ data.right = new FormAttachment(addButton, -5, SWT.LEFT);
+ sashForm.setLayoutData(data);
+
+ return sashForm;
+ }
+
+ private Composite makeTreeComposite(SashForm sashForm, Composite settingComposite,
Button addButton) {
- Composite treeComposite = new Composite(treeGroup, SWT.BORDER);
+ Composite treeComposite = new Composite(sashForm, SWT.BORDER);
treeStackLayout = new StackLayout();
treeComposite.setLayout(treeStackLayout);
- FormData data = new FormData();
- data.top = new FormAttachment(addButton, 0, SWT.TOP);
- data.bottom = new FormAttachment(100, 0);
- data.left = new FormAttachment(settingComposite, 5);
- data.right = new FormAttachment(addButton, -5, SWT.LEFT);
- treeComposite.setLayoutData(data);
-
makeTree(treeComposite);
treeSourceStyledText = makeSourceStyledText(treeComposite);
return treeComposite;
}
-
- private Composite makeSettingComposite(Group treeGroup, Button addButton) {
- Composite settingComposite = new Composite(treeGroup, SWT.NONE);
+
+ private Composite makeSettingComposite(SashForm sashForm, Button addButton) {
+ Composite settingComposite = new Composite(sashForm, SWT.NONE);
setttingStackLayout = new StackLayout();
settingComposite.setLayout(setttingStackLayout);
- FormData data = new FormData();
- data.top = new FormAttachment(addButton, 0, SWT.TOP);
- data.bottom = new FormAttachment(100, 0);
- data.left = new FormAttachment(0, 0);
- data.right = new FormAttachment(0, 200);
- settingComposite.setLayoutData(data);
-
staticComposite = makeStaticSettingComposite(settingComposite);
remoteComposite = makeRemoteSettingComposite(settingComposite);
runtimeComposite = makeRuntimeApiSettingComposite(settingComposite);
for (int i = 0; i < str.length; i++) {
makeTreeItemsFromJson(jsonObject, (String) str[i], parentTreeItem, 0);
}
+
+ //makeJsonFromDialogTree();
}
+
+ private void makeJsonFromDialogTree() {
+ JSONObject jsonObject = new JSONObject();
+ TreeItem[] subItems = dialogTree.getItems();
+
+ if (subItems.length != 0) {
+ for (TreeItem treeItem : subItems) {
+ makeJsonFromTreeItems(jsonObject, null, treeItem);
+
+ }
+ }
+
+ String str = jsonObject.toJSONString();
+ }
+
+ private void makeJsonFromTreeItems(JSONObject jsonObject, JSONArray list, TreeItem treeItem) {
+ TreeItemData treeItemData = (TreeItemData) treeItem.getData("TREEITEMDATA");
+ String objectType = treeItemData.getObjectType();
+ if ((objectType != null) && (objectType.equals("JSONArray"))) {
+ if (list == null) {
+ list = new JSONArray();
+ }
+
+ TreeItem[] subItems = treeItem.getItems();
+ if (subItems.length != 0) {
+ for (TreeItem subItem : subItems) {
+ makeJsonFromTreeItems(null, list, subItem);
+ }
+ jsonObject.put(treeItem.getText(), list);
+ }
+
+ } else if ((objectType != null) && (objectType.equals("JSONObject"))) {
+
+ } else {
+ if (list == null) {
+ jsonObject.put(treeItem.getText(), treeItemData.getObjectValue());
+ } else {
+ list.add(treeItemData.getObjectValue());
+ }
+ }
+
+ }
+
}
--- /dev/null
+/*
+ * UI Builder
+ *
+ * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+
+package org.tizen.webuibuilder.ui.views.databinding.actions;
+
+import org.eclipse.gef.ui.actions.SelectionAction;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.IPage;
+import org.tizen.webuibuilder.ui.views.databinding.DataBindingPage;
+import org.tizen.webuibuilder.ui.views.databinding.DataBindingView;
+
+public class AddViewModelItemAction extends SelectionAction {
+
+ protected DataBindingView view;
+
+ /**
+ * Constructor.
+ *
+ * @param text
+ * @param view
+ */
+ public AddViewModelItemAction(String text, DataBindingView view) {
+ super(null);
+ setText(text);
+ this.view = view;
+ setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
+ .getImageDescriptor(ISharedImages.IMG_OBJ_ADD));
+ }
+
+ @Override
+ protected boolean calculateEnabled() {
+ if (view == null) {
+ return false;
+ }
+
+ // if (!view.isActive()) {
+ // return false;
+ // }
+
+ return true;
+ }
+
+ @Override
+ public void run() {
+ IPage page = view.getCurrentPage();
+ if (!(page instanceof DataBindingPage)) {
+ return;
+ }
+ DataBindingPage dataBindingPage = (DataBindingPage) page;
+ if (dataBindingPage.addViewModelItem() != null) {
+ dataBindingPage.updateModel();
+ }
+ }
+
+}
private BindingData model;
private String originModelName;
- private int viewModelCount;
private String objectType;
private String objectValue;
}
/**
- * Gets a view model number.
- *
- * @return view model number
- */
- public int getViewModelCount() {
- return viewModelCount;
- }
-
- /**
- * Sets a view model number.
- *
- * @param viewModelCount
- */
- public void setViewModelCount(int viewModelCount) {
- this.viewModelCount = viewModelCount;
- }
-
- /**
* Gets a object type.
*
* @return object type
import org.eclipse.jface.text.DocumentEvent;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jst.pagedesigner.editors.HTMLEditor;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
import org.tizen.webuibuilder.commands.SetPartPropertyCommand;
import org.tizen.webuibuilder.model.PagePart;
import org.tizen.webuibuilder.model.Part;
ErrorDialog.open("Couldn't open HTML editor");
}
- HTMLEditor editor = null;
- if (htmlEditor instanceof HTMLEditor) {
- editor = (HTMLEditor) htmlEditor;
+ StructuredTextEditor editor = null;
+ if (htmlEditor instanceof StructuredTextEditor) {
+ editor = (StructuredTextEditor) htmlEditor;
} else {
ErrorDialog.open("Current active editor isn't jst page designer");
return;
}
- editor.setDesignerMode(HTMLEditor.MODE_SOURCE);
- editor.getTextEditor().setFocus();
+ editor.setFocus();
- document = editor.getDocument();
+ document = editor.getDocumentProvider().getDocument(editor.getEditorInput());
InitializeHtmlBlocks(document);
InitializeMarker(document);
setInitialCursorPosition(editor);
document.addDocumentListener(this);
}
- private void setInitialCursorPosition(HTMLEditor editor) {
+ private void setInitialCursorPosition(StructuredTextEditor editor) {
HTMLBlock currentBlock = getCurrentHtmlBlock();
if (currentBlock != null) {
int startOffset = currentBlock.getStartOffset();
int endOffset = currentBlock.getEndOffset();
- editor.getTextEditor().selectAndReveal(startOffset, endOffset - startOffset);
+ //editor.getTextEditor().selectAndReveal(startOffset, endOffset - startOffset);
+ editor.selectAndReveal(startOffset, endOffset - startOffset);
}
}
return pageFileData;
}
- // private DescriptorManager getDescriptorManager() {
- // //return DescriptorManager.getInstance(model.getProject());
- // return model.getDescriptorManager();
- // }
-
private IEditorPart getActiveEditor() {
IEditorPart editorPart = getActivePage().getActiveEditor();
return editorPart;