From e9d6c68605c9faea3c8c4ae1378228bdf97a36ac Mon Sep 17 00:00:00 2001 From: Erjan Gavalji Date: Fri, 5 Jun 2015 16:47:01 +0300 Subject: [PATCH] Remove the non-implemented tool-bar component --- ui/tool-bar/package.json | 2 -- ui/tool-bar/tool-bar-common.ts | 25 -------------------- ui/tool-bar/tool-bar.android.ts | 27 ---------------------- ui/tool-bar/tool-bar.d.ts | 32 ------------------------- ui/tool-bar/tool-bar.ios.ts | 41 --------------------------------- 5 files changed, 127 deletions(-) delete mode 100644 ui/tool-bar/package.json delete mode 100644 ui/tool-bar/tool-bar-common.ts delete mode 100644 ui/tool-bar/tool-bar.android.ts delete mode 100644 ui/tool-bar/tool-bar.d.ts delete mode 100644 ui/tool-bar/tool-bar.ios.ts diff --git a/ui/tool-bar/package.json b/ui/tool-bar/package.json deleted file mode 100644 index 89ce4bda8..000000000 --- a/ui/tool-bar/package.json +++ /dev/null @@ -1,2 +0,0 @@ -{ "name" : "tool-bar", - "main" : "tool-bar.js" } \ No newline at end of file diff --git a/ui/tool-bar/tool-bar-common.ts b/ui/tool-bar/tool-bar-common.ts deleted file mode 100644 index efcc91c11..000000000 --- a/ui/tool-bar/tool-bar-common.ts +++ /dev/null @@ -1,25 +0,0 @@ -import definition = require("ui/tool-bar"); -import view = require("ui/core/view"); -import proxy = require("ui/core/proxy"); -import dependencyObservable = require("ui/core/dependency-observable"); - -export module knownCollections { - export var items = "items"; -} - -export class ToolBar extends view.View implements definition.ToolBar { - public _addArrayFromBuilder(name: string, value: Array) { - if (name === "items") { - this._setValue(ToolBar.itemsProperty, value); - } - } - - get items(): Array { - return this._getValue(ToolBar.itemsProperty); - } - set items(value: Array) { - this._setValue(ToolBar.itemsProperty, value); - } - - public static itemsProperty = new dependencyObservable.Property("items", "ToolBar", new proxy.PropertyMetadata(undefined)) -} \ No newline at end of file diff --git a/ui/tool-bar/tool-bar.android.ts b/ui/tool-bar/tool-bar.android.ts deleted file mode 100644 index dbfd4f9ee..000000000 --- a/ui/tool-bar/tool-bar.android.ts +++ /dev/null @@ -1,27 +0,0 @@ -import common = require("ui/tool-bar/tool-bar-common"); -import dependencyObservable = require("ui/core/dependency-observable"); -import proxy = require("ui/core/proxy"); - -// merge the exports of the common file with the exports of this file -declare var exports; -require("utils/module-merge").merge(common, exports); - -function onItemsPropertyChanged(data: dependencyObservable.PropertyChangeData) { - var view = data.object; - if (!view.android) { - return; - } -} -(common.ToolBar.itemsProperty.metadata).onSetNativeValue = onItemsPropertyChanged; - -export class ToolBar extends common.ToolBar { - private _android: any; - - public _createUI() { - this._android = new (android.widget).Toolbar(this._context); - } - - get android(): any { - return this._android; - } -} \ No newline at end of file diff --git a/ui/tool-bar/tool-bar.d.ts b/ui/tool-bar/tool-bar.d.ts deleted file mode 100644 index 73308faec..000000000 --- a/ui/tool-bar/tool-bar.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Contains the ToolBar class, which represents a ToolBar component. - */ -declare module "ui/tool-bar" { - import view = require("ui/core/view"); - import dependencyObservable = require("ui/core/dependency-observable"); - - /** - * Represents a ToolBar item. - */ - interface ToolBarItem { - /** - * Gets or sets the title of the ToolBar. - */ - view: view.View; - } - - /** - * Represents a UI ToolBar component. - */ - export class ToolBar extends view.View { - /** - * Gets or sets the items of the ToolBar. - */ - items: Array; - - /** - * Gets or sets the items dependency property of the ToolBar. - */ - public static itemsProperty: dependencyObservable.Property; - } -} \ No newline at end of file diff --git a/ui/tool-bar/tool-bar.ios.ts b/ui/tool-bar/tool-bar.ios.ts deleted file mode 100644 index 222aac9fb..000000000 --- a/ui/tool-bar/tool-bar.ios.ts +++ /dev/null @@ -1,41 +0,0 @@ -import definition = require("ui/tool-bar"); -import common = require("ui/tool-bar/tool-bar-common"); -import dependencyObservable = require("ui/core/dependency-observable"); -import proxy = require("ui/core/proxy"); -import view = require("ui/core/view"); - -// merge the exports of the common file with the exports of this file -declare var exports; -require("utils/module-merge").merge(common, exports); - -function onItemsPropertyChanged(data: dependencyObservable.PropertyChangeData) { - var bar = data.object; - if (!bar.ios) { - return; - } - - var items = new NSMutableArray(); - for (var element in >data.newValue) { - if (element.view instanceof view.View) { - bar._addView(element.view); - items.addObject(element.view.ios); - } - } - - bar.ios.setItemsAnimated(items, false); -} -(common.ToolBar.itemsProperty.metadata).onSetNativeValue = onItemsPropertyChanged; - -export class ToolBar extends common.ToolBar { - private _ios: UIToolbar; - - constructor() { - super(); - - this._ios = UIToolbar.new(); - } - - get ios(): UIToolbar { - return this._ios; - } -} \ No newline at end of file