Open husker-dev opened 5 years ago
You can't easily change it because it's hardcoded in SelectablePanelPainter
that is used in the current componentpane.xml
style for the WebComponentPane
:
<!-- Container panel -->
<style type="panel" id="componentpane">
<!-- Single panel -->
<style type="panel" id="panel">
<painter class="SelectablePanelPainter" />
</style>
</style>
You can add a separate temporary painter implementation until it's fixed though - just need to make a custom painter similar to SelectablePanelPainter
and register it's annotation in StyleManager
to be useable in the skin XML files.
Either way, I've added this issue into the #535 list and I will be adjusting the component to be properly styleable in the v1.2.11 update.
I easily changed it :D
public class MovableComponentList extends WebComponentPane {
public MovableComponentList(){
setStyleId(StyleId.componentpane);
setReorderingAllowed(true);
setShowReorderGrippers(false);
}
// Remove focus tracker
public WebSelectablePanel addElement(Component component){
WebSelectablePanel selectablePanel = super.addElement(component);
FocusManager.removeFocusTrackers(selectablePanel);
return selectablePanel;
}
}
This solution isn't perfect, because after components were added, changing showBordersWhenFocused(boolean)
won't help.
// Create variable showBordersWhenFocused
protected boolean showBordersWhenFocused = true;
// Add setter to showBordersWhenFocused
public void setShowBordersWhenFocused ( final boolean showBordersWhenFocused ){
this.showBordersWhenFocused = showBordersWhenFocused;
}
// Add getter to showBordersWhenFocused
public boolean isShowingBordersWhenFocused (){
return showBordersWhenFocused;
}
// Add testing for showBordersWhenFocused in initialisation
if (componentPane.isShowingBordersWhenFocused())
com.alee.managers.focus.FocusManager.addFocusTracker ( WebSelectablePanel.this, focusTracker );
It is fine workaround solution, but FocusTracker
won't even be needed once component is moved to proper styling as it will handle all states according to the style provided. It's a fairly simple component, so i'll be adjusting it quite soon, right after the v1.2.10 release (which is possibly happening today).
There are some complications I've encountered with this component, so I'll be moving it to v1.2.12 update as it might take some time and I don't want to delay the current update release any further.
Still working on this in background, but some important changes and fixes will be done to the library first (planned in upcoming v1.3.0 version). WebLaF versioning is also getting adjusted to appropriately reflect changes made in different updates and to allow me to push important fixes outside of larger updates.
I need to disable paint borders when element of
WebComponentPane
is focused. I tried to usesetFocusable(false)
but it doesn't help. How can I do it?