+/*
+ * 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.gef.commands;
import java.util.ArrayList;
+/*
+ * 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.gef.commands;
import org.eclipse.gef.commands.Command;
+/*
+ * 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.gef.commands;
import java.util.List;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.widgets.Display;
import org.tizen.webuibuilder.animator.ui.views.timeline.common.ColorResource;
-import org.tizen.webuibuilder.ui.views.databinding.DataBindingTooltipParser;
+import org.tizen.webuibuilder.ui.views.databinding.DataBindingHelper;
import org.tizen.webuibuilder.ui.views.databinding.model.DataBindingTooltipData;
// txt =
// "text: model0.title, attr: { href: model0.url, title: model0.detail },";
- List<DataBindingTooltipData> dataList = DataBindingTooltipParser.parse(txt);
+ List<DataBindingTooltipData> dataList = DataBindingHelper.parse(txt);
DataBindingTooltipInnerFigure child = null;
for (DataBindingTooltipData data : dataList) {
import org.tizen.webuibuilder.ui.editor.dnd.listener.PageDesignerDropTargetListener;
import org.tizen.webuibuilder.ui.editor.ruler.DesignerGuide;
import org.tizen.webuibuilder.ui.editor.ruler.commands.ChangeGuideCommand;
-import org.tizen.webuibuilder.ui.views.databinding.DataBindingTooltipParser;
+import org.tizen.webuibuilder.ui.views.databinding.DataBindingHelper;
public class DesignerXYLayoutEditPolicy extends HoverViewerXYLayoutEditPolicy {
item.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
String str = targetPart.getProperty(BuilderConstants.ATTRIBUTE_DATA_BIND).getValue();
- final String info = DataBindingTooltipParser.makeInfoString(targetPart, property2.getValue(), displayName, value, str);
+ final String info = DataBindingHelper.makeInfoString(targetPart, property2.getValue(), displayName, value, str);
command =
new SetPartPropertyCommand(targetPart, BuilderConstants.ATTRIBUTE_DATA_BIND,
info);
dataType = treeItemData.getObjectType();
}
- String viewModelInfo = DataBindingTooltipParser.makeViewModelInfo(selection[0]);
+ String viewModelInfo = DataBindingHelper.makeViewModelInfo(selection[0]);
// FIXME "id"
DataBindingTemplate dataBindingTemplate =
+/*
+ * 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;
import org.eclipse.gef.commands.CommandStack;
-
+/*
+ * 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;
import org.tizen.webuibuilder.ui.views.databinding.model.TreeItemData;
-public class DataBindingTooltipParser {
+public class DataBindingHelper {
public static List<DataBindingTooltipData> parse(String txt) {
List<DataBindingTooltipData> list = new ArrayList<DataBindingTooltipData>();
DataBindingTooltipData data = null;
String string = "";
if ((str != null) && (!str.isEmpty())) {
- Map<String, String> bindingInfos = DataBindingTooltipParser.parseToMap(str);
+ Map<String, String> bindingInfos = DataBindingHelper.parseToMap(str);
if (bindingInfos.containsKey(value)) {
bindingInfos.remove(value);
bindingInfos.put(value, viewModelInfo);
}
- string = DataBindingTooltipParser.makeStringFromMap(bindingInfos);
+ string = DataBindingHelper.makeStringFromMap(bindingInfos);
} else {
if ((displayName != null) && (!displayName.isEmpty())) {
string = value + ": { " + displayName + ": " + viewModelInfo + " }";
.getData("TREEITEMDATA")).getObjectType().equals("Array"))) {
viewModelInfo = BuilderConstants.DATABINDING_ARRAYITEM_VALUE_PREFIX + treeItem.getText();
} else {
- viewModelInfo = DataBindingTooltipParser.makeViewModelInfoString(treeItem);
+ viewModelInfo = DataBindingHelper.makeViewModelInfoString(treeItem);
}
return viewModelInfo;
}
part.getProperty(BuilderConstants.ATTRIBUTE_DATA_BIND).getValue();
if ((propertyValue != null) && (!propertyValue.isEmpty())) {
- Map<String, String> bindingInfos = DataBindingTooltipParser.parseToMap(propertyValue);
+ Map<String, String> bindingInfos = DataBindingHelper.parseToMap(propertyValue);
Object[] bindingTypes = bindingInfos.keySet().toArray();
for (Object bindingType : bindingTypes) {
String key = bindingType.toString();
public void setBindingInfoToPart(Part targetPart, String viewModelInfo, String infoDisplayName,
String infoValue) {
String str = targetPart.getProperty(BuilderConstants.ATTRIBUTE_DATA_BIND).getValue();
- final String info = DataBindingTooltipParser.makeInfoString(targetPart, viewModelInfo, infoDisplayName, infoValue, str);
+ final String info = DataBindingHelper.makeInfoString(targetPart, viewModelInfo, infoDisplayName, infoValue, str);
getCommandStackFromPageDesigner().execute(new SetPartPropertyCommand(targetPart, BuilderConstants.ATTRIBUTE_DATA_BIND, info));
}
String propertyValue =
part.getProperty(BuilderConstants.ATTRIBUTE_DATA_BIND).getValue();
if ((propertyValue != null) && (!propertyValue.isEmpty())) {
- Map<String, String> bindingInfos = DataBindingTooltipParser.parseToMap(propertyValue);
+ Map<String, String> bindingInfos = DataBindingHelper.parseToMap(propertyValue);
Object[] bindingTypes = bindingInfos.keySet().toArray();
for (Object bindingType : bindingTypes) {
if ((tableTypeValue != null) && (bindingType.toString().equals(tableTypeValue))) {
bindingInfos.remove(bindingType);
- removeInfoTableItem(part, DataBindingTooltipParser.makeStringFromMap(bindingInfos));
+ removeInfoTableItem(part, DataBindingHelper.makeStringFromMap(bindingInfos));
}
}
}
String propertyValue =
part.getProperty(BuilderConstants.ATTRIBUTE_DATA_BIND).getValue();
if ((propertyValue != null) && (!propertyValue.isEmpty())) {
- Map<String, String> bindingInfos = DataBindingTooltipParser.parseToMap(propertyValue);
+ Map<String, String> bindingInfos = DataBindingHelper.parseToMap(propertyValue);
Object[] bindingTypes = bindingInfos.keySet().toArray();
for (Object bindingType : bindingTypes) {
String value = bindingInfos.get(bindingType);
value = value.replace(oldValue, newValue);
bindingInfos.remove(bindingType.toString());
bindingInfos.put(bindingType.toString(), value);
- String bindingInfo = DataBindingTooltipParser.makeStringFromMap(bindingInfos);
+ String bindingInfo = DataBindingHelper.makeStringFromMap(bindingInfos);
part.setPropertyValue(BuilderConstants.ATTRIBUTE_DATA_BIND, bindingInfo);
}
}
import org.eclipse.ui.part.IPage;
import org.tizen.webuibuilder.model.Part;
import org.tizen.webuibuilder.ui.views.databinding.DataBindingPage;
-import org.tizen.webuibuilder.ui.views.databinding.DataBindingTooltipParser;
+import org.tizen.webuibuilder.ui.views.databinding.DataBindingHelper;
import org.tizen.webuibuilder.ui.views.databinding.DataBindingView;
import org.tizen.webuibuilder.ui.views.databinding.dialog.SetTargetPage;
import org.tizen.webuibuilder.ui.views.databinding.model.BindingInfo;
String infoValue = bindingInfo.getInfoValue();
String infoDisplayName = bindingInfo.getInfoDisplayName();
- String viewModelInfo = DataBindingTooltipParser.makeViewModelInfo(treeItem);
+ String viewModelInfo = DataBindingHelper.makeViewModelInfo(treeItem);
if (targetPart != null) {
dataBindingPage.setBindingInfoToPart(targetPart, viewModelInfo, infoDisplayName, infoValue);
+/*
+ * 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.model;
+/*
+ * 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.model;
import org.tizen.webuibuilder.model.Part;
-
+/*
+ * 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.model;
+/*
+ * 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.model;
import java.util.EventListener;