mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-05 04:38:10 +08:00
PL-8237 Introduce non-recursive variant of Component.isVisible and Component.isEnabled
This commit is contained in:
parent
d1c7b5e7ef
commit
bc84b964f7
@ -218,6 +218,16 @@ public abstract class DesktopAbstractComponent<C extends JComponent>
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisibleItself() {
|
||||
return visible;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabledItself() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestFocus() {
|
||||
SwingUtilities.invokeLater(() ->
|
||||
|
@ -323,6 +323,16 @@ public class DesktopPopupButton extends DesktopAbstractActionsHolderComponent<JB
|
||||
public void setVisible(boolean visible) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisibleItself() {
|
||||
return DesktopPopupButton.this.isVisibleItself();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabledItself() {
|
||||
return action.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestFocus() {
|
||||
}
|
||||
|
@ -1131,6 +1131,16 @@ public class DesktopWindow implements Window, Component.Disposable,
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisibleItself() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabledItself() {
|
||||
return panel.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestFocus() {
|
||||
}
|
||||
|
@ -138,6 +138,16 @@ public class AbstractFrame implements Frame, Frame.Wrapper, Component.Wrapper, C
|
||||
frame.setVisible(visible);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisibleItself() {
|
||||
return frame.isVisibleItself();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabledItself() {
|
||||
return frame.isEnabledItself();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestFocus() {
|
||||
frame.requestFocus();
|
||||
|
@ -72,16 +72,30 @@ public interface Component {
|
||||
/** INTERNAL. Managed by debug Id system. */
|
||||
void setDebugId(String id);
|
||||
|
||||
/** Is component in enabled state? */
|
||||
/**
|
||||
* Are the component and its parent enabled?
|
||||
*/
|
||||
boolean isEnabled();
|
||||
/** Set component enabled state */
|
||||
void setEnabled(boolean enabled);
|
||||
|
||||
/** Is component visible? */
|
||||
/**
|
||||
* Are the component and its parent visible?
|
||||
*/
|
||||
boolean isVisible();
|
||||
/** Set component visibility */
|
||||
void setVisible(boolean visible);
|
||||
|
||||
/**
|
||||
* Is the component visible regardless of the parent?
|
||||
*/
|
||||
boolean isVisibleItself();
|
||||
|
||||
/**
|
||||
* Is the component enabled regardless of the parent?
|
||||
*/
|
||||
boolean isEnabledItself();
|
||||
|
||||
/** Set focus to this component */
|
||||
void requestFocus();
|
||||
|
||||
|
@ -736,6 +736,16 @@ public interface Table<E extends Entity>
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisibleItself() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabledItself() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestFocus() {
|
||||
}
|
||||
|
@ -218,6 +218,16 @@ public class ParamWrapper implements Component.HasValue {
|
||||
public void setVisible(boolean visible) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisibleItself() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabledItself() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestFocus() {
|
||||
}
|
||||
|
@ -886,6 +886,16 @@ public class WebWindow implements Window, Component.Wrapper,
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisibleItself() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabledItself() {
|
||||
return component.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestFocus() {
|
||||
}
|
||||
|
@ -208,6 +208,16 @@ public abstract class WebAbstractComponent<T extends com.vaadin.ui.AbstractCompo
|
||||
getComposition().setVisible(visible);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisibleItself() {
|
||||
return component.isVisible();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabledItself() {
|
||||
return component.isEnabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
|
Loading…
Reference in New Issue
Block a user