Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » How to FXGraph include with attributes
How to FXGraph include with attributes [message #1760144] Sun, 23 April 2017 18:07 Go to next message
John Bodkin is currently offline John BodkinFriend
Messages: 39
Registered: November 2011
Member
How do I add attributes to FXGraph includes like you can do in FXML?

Using the latest e(fx)clipse) I created a plugin that has an FXGraph that creates a button.
component MyButton  {
	Button id myButton {
		maxWidth : const Double#POSITIVE_INFINITY,
		mnemonicParsing : false
	}
}


In a different plugin I create another FXGraph that includes the button into an HBox but the button will not grow horizontally to fill the entire width.

...
					HBox {
						padding : Insets {
							bottom : 5.0,
							left : 5.0,
							right : 5.0,
							top : 10.0
						},
						spacing : 2.0,
						alignment : "CENTER",
						children : [
							include MyButton as myBtn
						]
					}
...


The above FXGraph will generate an FXML that looks like:
...
				<HBox spacing="2.0" alignment="CENTER"> 
					<padding>
						<Insets bottom="5.0" left="5.0" right="5.0" top="10.0"/> 
					</padding>
					<children>
						<fx:include fx:id="myBtn" source="MyButton.fxml" />
					</children>
				</HBox>

...


Inside the FXML I can add to the <fx:include /> HBox.hgrow="ALWAYS" and get the desired result.

...
				<HBox spacing="2.0" alignment="CENTER"> 
					<padding>
						<Insets bottom="5.0" left="5.0" right="5.0" top="10.0"/> 
					</padding>
					<children>
						<fx:include fx:id="myBtn" source="MyButton.fxml" HBox.hgrow="ALWAYS"/>
					</children>
				</HBox>

...


Re: How to FXGraph include with attributes [message #1760179 is a reply to message #1760144] Mon, 24 April 2017 10:35 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6313
Registered: July 2009
Senior Member
I think we currently don't support this! Please file a ticket at https://github.com/eclipse/efxclipse-eclipse
Re: How to FXGraph include with attributes [message #1760831 is a reply to message #1760179] Wed, 03 May 2017 12:49 Go to previous message
Phil Kan is currently offline Phil KanFriend
Messages: 4
Registered: March 2017
Junior Member
I think this should work:

HBox{
	children : 
	[
		include MyButton as AppBar
		{
			static hgrow : "ALWAYS"
		}
	]
}
Previous Topic:Threading: SWT events/ FX events
Next Topic:@FXMLLoader and @LocalInstance
Goto Forum:
  


Current Time: Sat May 27 00:29:16 GMT 2017

Powered by FUDForum. Page generated in 0.03979 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software