code: private int getLayerIndex(Layer layer) {
  		for (int i = 0; i < view.getWidgetCount(); i++) {
  			LayerControlPanel layerPanel = (LayerControlPanel) view.getWidgetAt(i);
  			if (layerPanel.getLayer() == layer) {
  				return i;
  			}
  		}
  		return -1;
  	}
docs: ------------------------------------------------------------------------