javafx: adding tabs dynamically when user opens a new file - dynamic

This is my edited question.. I want a new tab to be displayed in the same window. In the main window, i have a menu bar. Suppose the user clicks open, a new tab must be created in the same window below the menu bar and so on..
Kindly give me some pointers since I am a beginner in javafx. I appreciate your time and effort.

use tabpane and add tabs to it programmatically
TabPane tabPane = new TabPane();
Tab mytab = new Tab("tab to be created programmatically");
mytab.setContent(put your data here);
tabPane.getTabs().add(mytab);
the tabpane should be in the window/node/scene that you are flirting with ...that's all

Related

Is there a way to automatically change the selected menu page in a master detail project when the detail changes?

Background:
My project uses the "Master Detail" project from Xamarin.Forms, so it comes equipped with the hamburger menu button in the top left which is supposed to be the main source of navigation throughout the app. However, my app requires the user to go through multiple of those screens without the use of the hamburger menu. But when a user uses my own buttons to change the detail, the hamburger menu still says the user is on the previous page.
For example, a user is on Page A. They click a button outside of the menu which sends them to Page B. The menu will still show Page A.
My Attempt:
I really didn't know where to start, so I tried taking the MenuItemType and passing it through the following function:
// This changes the screen without changing the menu and it works.
((MasterDetailPage)Application.Current.MainPage).Detail = new NavigationPage(new PageB());
// This was my attempt to change the menu.
(Application.Current.MainPage as MenuPage).RootPage.NavigateFromMenu((id)MenuItemType.PageB);
But that returned a Null Reference Exception when run.
I've also tried manually calling the list view associated with the hamburger menu and changing the selectedItem property, but that didn't work either. Is there any way to change the selected menu?
For Clarity:
Since StackOverflow won't let me post a video, here's a link to how the app acts. As you can see, I use the Menu to go to the "About" Page. I click a button on the screen which takes me back to the "Browse" Page. However, when I open the menu, it still says "About" is selected. I can't reselect "About" until the menu moves away, meaning I have to reopen "Browse" despite already being on that screen.
What I'm looking for is a function which will automatically change the selected menu item to "Browse" when I press that button on the "About" Page. The app is currently using a Master Detail Page which has the "Detail" component changing from the About Page to the Browse Page. The menu page is a Content Page which came built with the app beforehand.

Working with Multiple Windows

In my MainMenu.xib, I have the main window of my app with web view, Now i have added a new window (with text field and button) in MainMenu.xib.
I have problem to add a menu tab where i click and my newly added window appears (Not on app Launching). How to connect menu tab item with window..???
Thanks in Advance
Would you like to do it without a single line of code?
i.e. Using Binding.
Here we go:
Create a secondary Window that you want to open on menu click.
Uncheck "Release when Close"
Create a new menu item : ctrl+drag from menu to window, select "makeKeyAndOrderFront"
That's it.

Titanium: How to close TabGroup within its Tab?

How can I close the TabGroup within one of its tab ?
I want to close the tabGroup on a button click (Log out button) and want to display a window without the tab group. I know how to display a window but could find how to close tab group ?
I think, to hide tab group is not proper way. Also on another button (Login button) I am creating the tab group so...
Any suggestions ?
Thanks...
Just do this:
TabGroup.close();
Put your tabgroup name instead of TabGroup.
EDIT:
If you want to access your tab grop through out the app do this in your app.js file:
Ti.App.customTabGroup = customTabGroup;
and close the tabgroup like this:
Ti.App.customTabGroup.close();

How to add a new Menu at the end of MenuBar?

One question is : Now I want to add a new Menu at the end of MenuBar, not to add a menuitem at the known menu. just like the Xcode Items: The last menu is Help , I want to add a new Mneu(MyMenu) behind the Help Menu ? How to do ? Thanks very much!
Generally, you should not add or remove items in the main menu at run time, because it breaks your users' muscle memory. Enable or disable them instead, and you'll have a much better UI.
Assuming you've found a good reason to do this, the way to do it is to get the main menu from the shared NSApplication object, then insert the menu item for your new menu. The menu item's submenu is the actual menu you're inserting. (Of course, you can create the menu and menu item in IB and access the menu item through an outlet.)

Oracle Form Builder: Switching between tabs in a form

i am building a form in oracle forms builder
i have a tabbed canvas
i need to know how to swap to the next tab when a button is pressed
so what do i program into the next-tab button??
Best way normally is to navigate to an item on the new tab page, e.g.
GO_ITEM('BLOCK_NAME.ITEM_NAME');
OR you can make the tab page topmost explicitly:
SET_CANVAS_PROPERTY('CANVAS_NAME', TOPMOST_TAB_PAGE, 'TAB_PAGE_NAME');