From 4871b19c5898cdaa190fff2014b5c2f0de5149b2 Mon Sep 17 00:00:00 2001 From: Janne Valkealahti Date: Fri, 20 Oct 2023 09:03:08 +0100 Subject: [PATCH] Polish --- .../shell/component/view/control/Cell.java | 79 ------------------- .../shell/component/view/control/Control.java | 1 + .../component/view/control/cell/Cell.java | 1 + 3 files changed, 2 insertions(+), 79 deletions(-) delete mode 100644 spring-shell-core/src/main/java/org/springframework/shell/component/view/control/Cell.java diff --git a/spring-shell-core/src/main/java/org/springframework/shell/component/view/control/Cell.java b/spring-shell-core/src/main/java/org/springframework/shell/component/view/control/Cell.java deleted file mode 100644 index 4084bcd1..00000000 --- a/spring-shell-core/src/main/java/org/springframework/shell/component/view/control/Cell.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2023 the original author or authors. - * - * 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 - * - * https://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 org.springframework.shell.component.view.control; - -import org.springframework.shell.component.view.screen.Screen; - -/** - * Base interface for all cells. Typically a {@link Cell} is a building block in - * a {@link View} not needing to be aware of how it is drawn into a {@link Screen} - * but needs to aware of its "item", bounds via {@link Control} and other - * properties like {@code background}. - * - * @author Janne Valkealahti - */ -public interface Cell extends Control { - - /** - * Get item bound to a cell. - * - * @return item bound to a cell - */ - T getItem(); - - /** - * Sets an item to bound into a cell. - * - * @param item item to bound into a cell - */ - void setItem(T item); - - /** - * Sets a style. - * - * @param style the style - */ - void setStyle(int style); - - /** - * Sets a foreground color. - * - * @param foregroundColor the background color - */ - void setForegroundColor(int foregroundColor); - - /** - * Sets a background color. - * - * @param backgroundColor the background color - */ - void setBackgroundColor(int backgroundColor); - - /** - * Return if cell is selected. - * - * @return true if cell is selected - */ - boolean isSelected(); - - /** - * Update selected status. - * - * @param selected true if cell is selected - */ - void updateSelected(boolean selected); - -} diff --git a/spring-shell-core/src/main/java/org/springframework/shell/component/view/control/Control.java b/spring-shell-core/src/main/java/org/springframework/shell/component/view/control/Control.java index a9f7b640..8a9ead4a 100644 --- a/spring-shell-core/src/main/java/org/springframework/shell/component/view/control/Control.java +++ b/spring-shell-core/src/main/java/org/springframework/shell/component/view/control/Control.java @@ -16,6 +16,7 @@ package org.springframework.shell.component.view.control; import org.springframework.lang.Nullable; +import org.springframework.shell.component.view.control.cell.Cell; import org.springframework.shell.component.view.screen.Screen; import org.springframework.shell.geom.Rectangle; import org.springframework.shell.style.ThemeResolver; diff --git a/spring-shell-core/src/main/java/org/springframework/shell/component/view/control/cell/Cell.java b/spring-shell-core/src/main/java/org/springframework/shell/component/view/control/cell/Cell.java index f1a5fd15..107dab78 100644 --- a/spring-shell-core/src/main/java/org/springframework/shell/component/view/control/cell/Cell.java +++ b/spring-shell-core/src/main/java/org/springframework/shell/component/view/control/cell/Cell.java @@ -16,6 +16,7 @@ package org.springframework.shell.component.view.control.cell; import org.springframework.shell.component.view.control.Control; +import org.springframework.shell.component.view.control.View; import org.springframework.shell.component.view.screen.Screen; /**