Skip to content

Commit

Permalink
Fixes: #4 - Move components from package to own classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasz Byczynski committed Dec 7, 2014
1 parent efdb24c commit ec64e46
Show file tree
Hide file tree
Showing 46 changed files with 371 additions and 184 deletions.
10 changes: 10 additions & 0 deletions .idea/codeStyleSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/libraries/SBT___scala_compiler_bundle_2_10_4.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .idea/libraries/SBT__com_vaadin_vaadin_server_7_3_6.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .idea/libraries/SBT__com_vaadin_vaadin_shared_7_3_6.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/SBT__org_scala_lang_scala_library_2_10_4.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions .idea/sbt.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

68 changes: 68 additions & 0 deletions addon/project/.idea/modules/project-build.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions addon/project/.idea/modules/project.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions addon/src/main/scala/org/vaadin/addons/rinne/VAbsoluteLayout.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.vaadin.addons.rinne

import com.vaadin.ui.{AbsoluteLayout, Component}
import org.vaadin.addons.rinne.mixins.AbstractLayoutMixin

class VAbsoluteLayout extends AbsoluteLayout with AbstractLayoutMixin {

def add[C <: Component](component: C, location: String): C = {
addComponent(component, location)
component
}

}
6 changes: 6 additions & 0 deletions addon/src/main/scala/org/vaadin/addons/rinne/VAccordion.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.vaadin.addons.rinne

import com.vaadin.ui.Accordion
import org.vaadin.addons.rinne.mixins.TabSheetMixin

class VAccordion extends Accordion with TabSheetMixin
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.vaadin.addons.rinne.mixins
package org.vaadin.addons.rinne

import org.vaadin.addons.rinne.KeyShortcut
import org.vaadin.addons.rinne.events._
import com.vaadin.ui.Button
import org.vaadin.addons.rinne.events._
import org.vaadin.addons.rinne.mixins.{AbstractComponentMixin, FocusableMixin}

import scala.collection.JavaConverters._

trait ButtonMixin extends Button with AbstractComponentMixin with BlurNotifier with FocusNotifier with FocusableMixin {
class VButton extends Button with AbstractComponentMixin with BlurNotifier with FocusNotifier with FocusableMixin {

private var _clickKeyShortcut: Option[KeyShortcut] = None

Expand Down
13 changes: 13 additions & 0 deletions addon/src/main/scala/org/vaadin/addons/rinne/VCheckBox.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.vaadin.addons.rinne

import com.vaadin.ui.CheckBox
import org.vaadin.addons.rinne.mixins.AbstractFieldMixin

class VCheckBox extends CheckBox with AbstractFieldMixin[java.lang.Boolean] {

def value_=(value: Boolean) {
setValue(value)
}

def boolValue: Boolean = getValue
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package org.vaadin.addons.rinne.mixins
package org.vaadin.addons.rinne

import org.vaadin.addons.rinne.converters.Converters
import com.vaadin.shared.ui.combobox.FilteringMode
import com.vaadin.ui.ComboBox
import org.vaadin.addons.rinne.mixins.{ContainerMixin, ComponentMixin, AbstractSelectMixin}

trait ComboBoxMixin extends com.vaadin.ui.ComboBox with AbstractSelectMixin with ContainerMixin with SizeableMixin {

setConverter(Converters.optionToAny)
class VComboBox extends ComboBox with AbstractSelectMixin with ContainerMixin {

def inputPrompt: Option[String] = Option(getInputPrompt)

Expand Down
25 changes: 25 additions & 0 deletions addon/src/main/scala/org/vaadin/addons/rinne/VCssLayout.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package org.vaadin.addons.rinne

import com.vaadin.ui.{Component, CssLayout}
import org.vaadin.addons.rinne.events.LayoutClickNotifierMixin
import org.vaadin.addons.rinne.mixins.AbstractLayoutMixin

class VCssLayout extends CssLayout with AbstractLayoutMixin with LayoutClickNotifierMixin {

private var _cssMap = Map.empty[Component, String]

def add[C <: Component](component: C, css: => String = null): C = {
add(component)
if (css != null) {
_cssMap += component -> css
}
component
}

override def getCss(component: Component): String = _cssMap.getOrElse(component, "")

override def removeComponent(component: Component) = {
super.removeComponent(component)
_cssMap -= component
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.vaadin.addons.rinne

import com.vaadin.ui.{Component, CustomComponent}
import org.vaadin.addons.rinne.mixins.ComponentMixin

class VCustomComponent extends CustomComponent with ComponentMixin {

def compositionRoot: Option[Component] = Option(getCompositionRoot)

def compositionRoot_=(component: Component) {
setCompositionRoot(component)
}

def compositionRoot_=(component: Option[Component]) {
setCompositionRoot(component.orNull)
}
}
12 changes: 12 additions & 0 deletions addon/src/main/scala/org/vaadin/addons/rinne/VCustomField.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.vaadin.addons.rinne

import com.vaadin.ui.CustomField
import org.vaadin.addons.rinne.mixins.AbstractFieldMixin

import scala.reflect._

abstract class VCustomField[T: ClassTag] extends CustomField[T] with AbstractFieldMixin[T] {
private val _type = classTag[T].runtimeClass.asInstanceOf[Class[_ <: T]]

override def getType: Class[_ <: T] = _type
}
5 changes: 5 additions & 0 deletions addon/src/main/scala/org/vaadin/addons/rinne/VDateField.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.vaadin.addons.rinne

import org.vaadin.addons.rinne.mixins.DateFieldMixin

class VDateField extends DateFieldMixin
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.vaadin.addons.rinne

import com.vaadin.ui.FormLayout
import org.vaadin.addons.rinne.mixins.AbstractOrderedLayoutMixin

class VFormLayout extends FormLayout with AbstractOrderedLayoutMixin
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package org.vaadin.addons.rinne.mixins
package org.vaadin.addons.rinne

import com.vaadin.ui.{Alignment, Component, GridLayout}
import org.vaadin.addons.rinne.mixins.{AbstractLayoutMixin, MarginHandlerMixin, SpacingHandlerMixin}

trait GridLayoutMixin extends GridLayout with AbstractLayoutMixin with SpacingHandlerMixin with MarginHandlerMixin {
class VGridLayout extends GridLayout with AbstractLayoutMixin with SpacingHandlerMixin with MarginHandlerMixin {

def add[C <: Component](
component: C = null,
Expand All @@ -29,18 +30,26 @@ trait GridLayoutMixin extends GridLayout with AbstractLayoutMixin with SpacingHa

def columns: Int = getColumns

def columns_=(columns: Int) { setColumns(columns) }
def columns_=(columns: Int) {
setColumns(columns)
}

def rows: Int = getRows

def rows_=(rows: Int) { setRows(rows) }
def rows_=(rows: Int) {
setRows(rows)
}

def cursorX: Int = getCursorX

def cursorX_=(cursorX: Int) { setCursorX(cursorX) }
def cursorX_=(cursorX: Int) {
setCursorX(cursorX)
}

def cursorY: Int = getCursorY

def cursorY_=(cursorY: Int) { setCursorY(cursorY) }
def cursorY_=(cursorY: Int) {
setCursorY(cursorY)
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.vaadin.addons.rinne

import com.vaadin.ui.HorizontalLayout
import org.vaadin.addons.rinne.mixins.AbstractOrderedLayoutMixin

class VHorizontalLayout extends HorizontalLayout with AbstractOrderedLayoutMixin
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.vaadin.addons.rinne

import com.vaadin.ui.HorizontalSplitPanel
import org.vaadin.addons.rinne.mixins.AbstractSplitPanelMixin

class VHorizontalSplitPanel extends HorizontalSplitPanel with AbstractSplitPanelMixin
6 changes: 6 additions & 0 deletions addon/src/main/scala/org/vaadin/addons/rinne/VImage.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.vaadin.addons.rinne

import com.vaadin.ui.Image
import org.vaadin.addons.rinne.mixins.AbstractEmbeddedMixin

class VImage extends Image with AbstractEmbeddedMixin
Loading

0 comments on commit ec64e46

Please sign in to comment.