Java Code Examples for org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants#HMARGIN
The following examples show how to use
org.eclipse.ui.views.properties.tabbed.ITabbedPropertyConstants#HMARGIN .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ReflectivityDataPropertySection.java From ice with Eclipse Public License 1.0 | 4 votes |
/** * This operation draws the (initial) controls in the properties view based * on the input. Adds the <code>DataComponent</code> to a * <code>DataComponentComposite</code> to be used in the properties view. */ @Override public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) { super.createControls(parent, aTabbedPropertySheetPage); // Get the default background color. Color backgroundColor = parent.getBackground(); // Create a section for the data composites. section = getWidgetFactory().createSection(parent, Section.SHORT_TITLE_BAR | Section.DESCRIPTION); section.setText(data.getName()); section.setDescription(data.getDescription()); section.setBackground(backgroundColor); dataComposite = new DataComponentComposite(data, section, SWT.NONE); // Sets the entries to be enabled to the state of the isEnabled flag Control[] children = dataComposite.getChildren(); for (Control child : children) { if (child instanceof IEntryComposite) { IEntryComposite entry = (IEntryComposite) child; entry.getComposite().setEnabled(isEnabled); } } GridLayout clientLayout = new GridLayout(2, true); // Set the margins and spacing based on the tabbed property // constants. clientLayout.marginLeft = ITabbedPropertyConstants.HMARGIN; clientLayout.marginRight = ITabbedPropertyConstants.HMARGIN; clientLayout.marginTop = ITabbedPropertyConstants.VMARGIN; clientLayout.marginBottom = ITabbedPropertyConstants.VMARGIN; clientLayout.horizontalSpacing = ITabbedPropertyConstants.HSPACE; clientLayout.verticalSpacing = ITabbedPropertyConstants.VSPACE; dataComposite.setLayout(clientLayout); // Make the background of the section client white unless ICE is in // debug mode. if (System.getProperty("DebugICE") == null) { dataComposite.setBackground(backgroundColor); } else { dataComposite.setBackground( Display.getCurrent().getSystemColor(SWT.COLOR_RED)); } // Adapt the composite to be rendered with the default widget factory // toolkit getWidgetFactory().adapt(dataComposite); // Set the client area for the section. section.setClient(dataComposite); return; }
Example 2
Source File: ComponentPropertySection.java From ice with Eclipse Public License 1.0 | 4 votes |
/** * This operation draws the controls in the properties view based on the * input. */ @Override public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) { super.createControls(parent, aTabbedPropertySheetPage); // Get the default background color (white). Color backgroundColor = parent.getBackground(); // Create a section for the data composites. section = getWidgetFactory().createSection(parent, ExpandableComposite.SHORT_TITLE_BAR | Section.DESCRIPTION); section.setText("Node properties"); section.setDescription("All properties available for " + "this node can be modified here."); section.setBackground(backgroundColor); // Create the Composite that contains all DataComponentComposites. final Composite client = new Composite(section, SWT.NONE); // Set the layout of the client area so that all DataComponentComposites // are stacked on top of each other. GridLayout clientLayout = new GridLayout(); // Set the margins and spacing based on the tabbed property constants. clientLayout.marginLeft = ITabbedPropertyConstants.HMARGIN; clientLayout.marginRight = ITabbedPropertyConstants.HMARGIN; clientLayout.marginTop = ITabbedPropertyConstants.VMARGIN; clientLayout.marginBottom = ITabbedPropertyConstants.VMARGIN; clientLayout.horizontalSpacing = ITabbedPropertyConstants.HSPACE; clientLayout.verticalSpacing = ITabbedPropertyConstants.VSPACE; client.setLayout(clientLayout); // Make the background of the section client white unless ICE is in // debug mode. if (System.getProperty("DebugICE") == null) { client.setBackground(backgroundColor); } else { client.setBackground( Display.getCurrent().getSystemColor(SWT.COLOR_RED)); } // Set the client area for the section. section.setClient(client); // Get the property viewer's ScrolledComposite and its first Composite // (its "client" Composite). scrollCompositeClient = section.getParent().getParent().getParent() .getParent(); scrollComposite = (ScrolledComposite) scrollCompositeClient.getParent(); // Add a listener to resize the Section's properties and update the // ScrollComposite's minimum bounds correctly based on the displayed // properties. scrollComposite.addControlListener(new ControlAdapter() { @Override public void controlResized(ControlEvent e) { resizeProperties(); } }); return; }
Example 3
Source File: TreePropertySection.java From ice with Eclipse Public License 1.0 | 4 votes |
/** * This operation draws the (initial) controls in the properties view based * on the input. In this case, there are initially no widgets to prepare. */ @Override public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) { super.createControls(parent, aTabbedPropertySheetPage); // Get the default background color. Color backgroundColor = parent.getBackground(); // Create a section for the data composites. section = getWidgetFactory().createSection(parent, ExpandableComposite.SHORT_TITLE_BAR | Section.DESCRIPTION); section.setText("Node properties"); section.setDescription("All properties available for " + "this node can be modified here."); section.setBackground(backgroundColor); // Create the Composite that contains all DataComponentComposites. final Composite client = new Composite(section, SWT.NONE); GridLayout clientLayout = new GridLayout(2, false); // Set the margins and spacing based on the tabbed property constants. clientLayout.marginLeft = ITabbedPropertyConstants.HMARGIN; clientLayout.marginRight = ITabbedPropertyConstants.HMARGIN; clientLayout.marginTop = ITabbedPropertyConstants.VMARGIN; clientLayout.marginBottom = ITabbedPropertyConstants.VMARGIN; clientLayout.horizontalSpacing = ITabbedPropertyConstants.HSPACE; clientLayout.verticalSpacing = ITabbedPropertyConstants.VSPACE; client.setLayout(clientLayout); // Make the background of the section client white unless ICE is in // debug mode. if (System.getProperty("DebugICE") == null) { client.setBackground(backgroundColor); } else { client.setBackground( Display.getCurrent().getSystemColor(SWT.COLOR_RED)); } // Set the client area for the section. section.setClient(client); // Get the property viewer's ScrolledComposite and its first Composite // (its "client" Composite). scrollCompositeClient = section.getParent().getParent().getParent() .getParent(); scrollComposite = (ScrolledComposite) scrollCompositeClient.getParent(); // Add a listener to resize the Section's properties and update the // ScrollComposite's minimum bounds correctly based on the displayed // properties. scrollComposite.addControlListener(new ControlAdapter() { @Override public void controlResized(ControlEvent e) { resizePropertyView(); } }); // Create the type Combo Composite. typeComposite = createTypeComposite(client); GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false); gridData.horizontalSpan = 2; typeComposite.setLayoutData(gridData); // Refresh the contents of the type Combo and its containing Composite. refreshTypeWidgets(); // Create the table of properties. tableViewer = createTableViewer(client); // Set the table's layout data so it occupies all spare space in the // property section client. tableViewer.getControl() .setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); // Create the add/delete buttons. Composite buttonComposite = createButtons(client); // The button Composite shouldn't grab any space. Align it along the // center and top of the space to the right of the table. buttonComposite .setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false)); return; }