Metro app set startup object - page - microsoft-metro

How would I set a different startup page ?
the current page \ form is GroupedItemsPage
I want to change this to testpage ?
Thanks

You can change the default start page for your application by editing the package manifest that is in the root of your project.
Expand the node for your project
Double click package.appxmanifest
Select the start page option, and point it to the file you want.

In XAML-C#, There is no "start page" option on the package.appxmanifest. So the answer above does not work.
in App.xaml.cs, add the following:
protected override async void OnLaunched(LaunchActivatedEventArgs args)
{
...
rootFrame.Navigate(typeof(YourCustomStartupPage), "AllGroups");
}

Related

Programmatically open a specific tab of the Eclipse CDT project property page

I would like to open a specific tab of the Eclipse CDT project property page from code. For example the screenshot below shows the property page open on the Build Steps tab.
The following code opens the property page succesfully, but always the last accessed tab.
private void openProperties(IProject project) {
String ID = "org.eclipse.cdt.managedbuilder.ui.properties.Page_BuildSettings";
org.eclipse.swt.widgets.Shell shell = org.eclipse.swt.widgets.Display.getCurrent().getActiveShell();
org.eclipse.ui.dialogs.PreferencesUtil.createPropertyDialogOn(
shell, project,
ID, null, null, 0)
.open();
}
The thing I don't quite understand is the Settings page is declared using extension point="org.eclipse.ui.propertyPages" and has an ID. But the tabs are added using extension point="org.eclipse.cdt.ui.cPropertyTab" which does not include an ID. So how are the tabs addressed without an ID?
This is only a partial solution, but hopefully it helps:
Save the return value of createPropertyDialogOn(). It's a PreferenceDialog.
Call getSelectedPage() on it to get the IPreferencePage representing the page.
Most CDT preference pages, including the Build Settings page, extend from org.eclipse.cdt.ui.newui.AbstractPage. AbstractPage uses an SWT TabFolder widget to store the tabs.
Here's the fuzzy part: get a hold of the TabFolder widget for the page. Unfortunately, it's not exposed via any public API, so I think your options are:
Use reflection. The TabFolder is stored as a protected field of the AbstractPage named folder.
Search the SWT widget hierarchy rooted at page.getControl(), where page is the AbstractPage, for a TabFolder.
Once you have the tab control, you can use getItemCount() and getItem(index) on it to enumerate its items, which will be of type TabItem.
On each TabItem, call getData() to retrieve the associated ICPropertyTab.
Examine the ICPropertyTab object to see if it's the one you want to activate. In your case, that might be a check like tab instanceof org.eclipse.cdt.managedbuilder.ui.properties.BuildStepsTab.
Once you've found the right tab, activate it via folder.setSelection(item).

Ionic2 - Login and then Side menu

I am creating an App with Ionic2 and the requirement is -
- the app when first loaded will show a Log In page and when logged in
- will have a Side-Menu enabled pages
The starter project shows that the Side Menu as the root of the app and loads first before any other page is open - then it loads the other related pages.
How can I build an app that Loads Log In page first and then set the Side Menu as the main navigation and never shows up the Log In screen??
I did this with ionic 1 but not being able to figure out with ionic2
Please help.
One solution would be to disable menu on Login screen and then to enable it after login.
You can disable menu by injecting MenuController and then use:
import {NavController, MenuController} from 'ionic-angular';
ionViewDidEnter() {
//to disable menu, or
this.menu.enable(false);
}
ionViewWillLeave() {
// to enable menu.
this.menu.enable(true);
}
#Digital IQ, you have to set your login page as the rootPage in your existing app.ts file and use MenuController in login page to make menu enable onPageDidLeave.
The example for this is available in ionic conference app where they have tutorial page before getting in to the actual application. Refer this for menu control and this (line 50) to set the initial page.
The above problem must have occurred because the user had surely logged in, but the changes i.e. setting it as the current user didn't take place in side menu page.
For that you can use Events API
Events is a publish-subscribe style event system for sending and responding to application-level events across your app.
For reference, go through the following answer-
Ionic 3 refresh side menu after login
kind Attn [vahid najafi & Aish123]
I tried something more easy and I found it working.
I set the LogIn page as the root when the app first loaded - and I removed 'menuToggle' button from this template.
Then I imported the Component I want to redirect on Log in
I created a singIn function in LogInPage class as follows:
signIn (){
let navRef = this.app.getComponent('nav');
navRef.setRoot(HelloIonicPage);
}
and it worked like a charm

Breadcrumb doesn't work on a component I created (Joomla!)

I'm learning how to use Joomla! 3.2
I created a new component, then I added it to my main menu,
Here are the only parameters I changed in the main menu:
But now when I go to my new component the breadcrumb doesn't work correctly, there's only the home button and when I click on it I'm redirected to the same page:
Did i missed something very important? How can I fix it? The breadcrumb works on every other pages.
Ok I found the problem, I forgot to add this
$pathway = $app->getPathway();
$breadcrumb = $pathway->setPathway(array());
$pathway->addItem( JText::_( 'COM_PARTISPOLITIQUES' ),JRoute::_('index.php?option=com_partispolitiques&view=partispolitique'));
$pathway->addItem( "Current page name",'');
In the file view.html.php located in my component folder...
I am going to assume you are using the Helix template as it seems to be a common oversight.
Make sure that Enable Page Title is enabled from your menu Helix Page Title tab.
If not, please advise as to what template.

Eclipse RCP DirectoryDialog not showing initial directory

Im using a DirectoryDialog like this:
public static String showDialog(Composite parent, String path)
{
log.debug("Showing submission directory dialog");
Shell shell = parent.getShell();
DirectoryDialog dialog = new DirectoryDialog(shell);
dialog.setFilterPath(path);
return dialog.open();
}
Works fine, but the view is not showing the directory provided by the path. It is selected but not shown:
Should be something like this:
Any ideas?
Thanks in advance!
IMHO it is not possible. These are native dialogs of underlying OS, so the behaviour of these dialogs may change one OS to other.
Automatic scrolling to the selected folder may not possible.
Also check whether it works: Open DirectoryDialog and hide the hidden folders, so automatically the filter folder will be visible.

GWT: Opening new mail window without browser tab opened

I am trying to open an email client just like using mail me tag.
But I want to use my custom widget, which is not hyperlink, anchor or so. I added a DOM handler to my widget to listen to clicks:
public class VContactWidget extends VHorizontalLayout implements ClickHandler {
private HandlerRegistration clickHandler;
public VContactWidget() {
// added some content here
clickHandler = addDomHandler(this, ClickEvent.getType());
}
#Override
public void onClick(ClickEvent event) {
Window.open("mailto:john.doe#mail.com", "_blank", "");
}
}
Everything is working fine except one detail: When the widget is clicked, new empty browser tab will open with url set to mailto:john.doe#mail.com. I don't want the new tab opened. Can I avoid it somehow?
Note I set _blank parameter, as used in many examples. I also tried to use empty string or some other values as well. I looked into documentation, but didn't find anything useful.
https://developer.mozilla.org/en-US/docs/Web/API/window.open
One solution may be to use Anchor, but my component is more complex, not just single <a> link.
Another detail to note may be application server - I am using Tomcat 7 now.
Trying to fire native event on hidden Anchor programatically did not work for me. (Which does not mean it cannot be done.)
This is, how I actually solved my problem: Instead of Window.open(), I used following call:
public void onClick(ClickEvent event) {
Window.Location.assign("mailto:john.doe#mail.com");
}
This is not something that you can control. Whether this link opens in a new tab or a new window depends on the browser settings and user preferences.
I don't think it will make a difference if you use an Anchor or Window.open. In either case, the behavior may be different in different browsers. Also remember that for some users a click on this link will open Outlook or Mail, while for other users it will open Gmail in a browser window.
UPDATE:
If you want an exact behavior of an <a> element, create a hidden anchor element and fire a click on it when a user clicks on your composite widget.
Firing click event from code in gwt