JBIDE-16345 General Palette improvements

Improvements for Palette in order not to allow insert elements from Palette to the wrong places.