void () { int borders = switch (myToolbarAnchor) { case SwingConstants.TOP -> SideBorder.TOP; case SwingConstants.BOTTOM -> SideBorder.BOTTOM; case SwingConstants.LEFT -> SideBorder.LEFT; case SwingConstants.RIGHT -> SideBorder.RIGHT; default -> SideBorder.NONE; }; setViewerBorder(IdeBorderFactory.createBorder(borders)); }