Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds SpacerUpdater support for Escalator (#16644)
Change-Id: I9d73a3fc36e94e36c35859a4ae456002c75df2f5
- Loading branch information
Henrik Paul
committed
Feb 16, 2015
1 parent
556c1aa
commit c72967b
Showing
8 changed files
with
275 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright 2000-2014 Vaadin Ltd. | ||
* | ||
* 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. | ||
*/ | ||
package com.vaadin.client.widget.escalator; | ||
|
||
import com.google.gwt.dom.client.Element; | ||
|
||
/** | ||
* A representation of a spacer element in a {@link SpacerContainer}. | ||
* | ||
* @since | ||
* @author Vaadin Ltd | ||
*/ | ||
public interface Spacer { | ||
|
||
/** | ||
* Gets the root element for the spacer content. | ||
* | ||
* @return the root element for the spacer content | ||
*/ | ||
Element getElement(); | ||
|
||
/** | ||
* Gets the row index. | ||
* | ||
* @return the row index. | ||
*/ | ||
int getRow(); | ||
} |
62 changes: 62 additions & 0 deletions
62
client/src/com/vaadin/client/widget/escalator/SpacerUpdater.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Copyright 2000-2014 Vaadin Ltd. | ||
* | ||
* 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. | ||
*/ | ||
package com.vaadin.client.widget.escalator; | ||
|
||
/** | ||
* An interface that handles the display of content for spacers. | ||
* <p> | ||
* The updater is responsible for making sure all elements are properly | ||
* constructed and cleaned up. | ||
* | ||
* @since | ||
* @author Vaadin Ltd | ||
* @see Spacer | ||
* @see SpacerContainer | ||
*/ | ||
public interface SpacerUpdater { | ||
|
||
/** A spacer updater that does nothing. */ | ||
public static final SpacerUpdater NULL = new SpacerUpdater() { | ||
@Override | ||
public void init(Spacer spacer) { | ||
// NOOP | ||
} | ||
|
||
@Override | ||
public void destroy(Spacer spacer) { | ||
// NOOP | ||
} | ||
}; | ||
|
||
/** | ||
* Called whenever a spacer should be initialized with content. | ||
* | ||
* @param spacer | ||
* the spacer reference that should be initialized | ||
*/ | ||
void init(Spacer spacer); | ||
|
||
/** | ||
* Called whenever a spacer should be cleaned. | ||
* <p> | ||
* The structure to clean up is the same that has been constructed by | ||
* {@link #init(Spacer)}. | ||
* | ||
* @param spacer | ||
* the spacer reference that should be destroyed | ||
*/ | ||
void destroy(Spacer spacer); | ||
} |
Oops, something went wrong.