collapsible buttons layout issue [message #587895] |
Thu, 24 January 2008 12:23 |
Stefan Reger Messages: 2 Registered: July 2009 |
Junior Member |
|
|
This is a multi-part message in MIME format.
--------------060804060409090805000502
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
I have an issue concerning the collapsible buttons widget: the
ButtonsTester example works fine. I then try to use the widget in my RCP
ViewPart class and the added CustomButtons do not show, no matter how
often I call redraw, update, layout and so on.
I tracked down the error to the CollapsibleButtons.VerticalLayout class
which lays out the button only when button.isVisible is true. In the
ButtonsTester example this method returns true, in my RCP view it
returns false. The result is that the button does not receive a layout.
If I uncomment the visibility check the buttons are correctly displayed
and the collapse works too, but there is an issue with the toolbar at
the bottom of the composite.
Attached is my ViewPart class.
Regards,
Stefan Reger
--------------060804060409090805000502
Content-Type: text/plain;
name="ModuleBarView.java"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline;
filename="ModuleBarView.java"
package de.itscope.mv.ui.views;
import org.eclipse.nebula.widgets.collapsiblebuttons.CollapsibleBut tons;
import org.eclipse.nebula.widgets.collapsiblebuttons.CustomButton;
import org.eclipse.nebula.widgets.collapsiblebuttons.IButtonListene r;
import org.eclipse.nebula.widgets.collapsiblebuttons.ImageCache;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.ui.part.ViewPart;
import de.itscope.mv.ui.MvGuiPlugin;
public class ModuleBarView extends ViewPart {
public static final String ID = "de.itscope.mv.ui.views.ModuleBarView"; //$NON-NLS-1$
private CollapsibleButtons bc;
/**
* Create contents of the view part
* @param parent
*/
@Override
public void createPartControl(Composite parent) {
final GridLayout gridLayout = new GridLayout();
gridLayout.verticalSpacing = 0;
gridLayout.marginWidth = 0;
gridLayout.marginHeight = 0;
gridLayout.horizontalSpacing = 0;
parent.setLayout(gridLayout);
final Composite composite = new Composite(parent, SWT.NONE);
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
composite.setBackground(SWTResourceManager.getColor(214, 223, 247));
composite.setLayout(new GridLayout());
final ToolBar toolBar = new ToolBar(composite, SWT.VERTICAL);
toolBar.setBackground(SWTResourceManager.getColor(214, 223, 247));
final GridData gd_toolBar = new GridData(SWT.CENTER, SWT.TOP, false, false);
gd_toolBar.verticalIndent = 5;
gd_toolBar.horizontalIndent = 5;
toolBar.setLayoutData(gd_toolBar);
final ToolItem newItemToolItem = new ToolItem(toolBar, SWT.RADIO);
newItemToolItem.setImage(ResourceManager.getPluginImage(MvGu iPlugin.getDefault(), "oxicons/24x24/devices/gba.png"));
newItemToolItem.setText("ITscope-Katalog");
final ToolItem newItemToolItem_1 = new ToolItem(toolBar, SWT.RADIO);
newItemToolItem_1.setImage(ResourceManager.getPluginImage(Mv GuiPlugin.getDefault(), "oxicons/24x24/devices/cdrom_unmount.png"));
newItemToolItem_1.setText("Produktlisten");
final ToolItem newItemToolItem_2 = new ToolItem(toolBar, SWT.RADIO);
newItemToolItem_2.setImage(ResourceManager.getPluginImage(Mv GuiPlugin.getDefault(), "oxicons/24x24/devices/gnome-dev-harddisk-1394.png"));
newItemToolItem_2.setText("Produktvergleich");
final ToolItem newItemToolItem_3 = new ToolItem(toolBar, SWT.PUSH);
newItemToolItem_3.setImage(ResourceManager.getPluginImage(Mv GuiPlugin.getDefault(), "oxicons/24x24/devices/multimedia-player.png"));
newItemToolItem_3.setText("Kalkulation");
final ToolItem newItemToolItem_4 = new ToolItem(toolBar, SWT.PUSH);
newItemToolItem_4.setImage(ResourceManager.getPluginImage(Mv GuiPlugin.getDefault(), "oxicons/24x24/devices/video-display.png"));
newItemToolItem_4.setText("Statistik");
bc = new CollapsibleButtons(parent, SWT.BORDER);
bc.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, true, false));
bc.addButton("Produkte", null, ResourceManager.getPluginImage(MvGuiPlugin.getDefault(), "oxicons/24x24/devices/cdrom_unmount.png"), ResourceManager.getPluginImage(MvGuiPlugin.getDefault(), "oxicons/16x16/devices/cdrom_unmount.png"));
bc.addButton("Vorg
|
|
|
Powered by
FUDForum. Page generated in 0.03027 seconds