MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / setTitle

Method setTitle

CodenameOne/src/com/codename1/ui/Form.java:1972–2010  ·  view source on GitHub ↗
(String title)

Source from the content-addressed store, hash-verified

1970 ///
1971 /// - `title`: the form title
1972 public void setTitle(String title) {
1973 if (toolbar != null) {
1974 toolbar.setTitle(title);
1975 // in desktop "native" mode the toolbar is hidden; push the title to the OS window title
1976 // bar instead. In "custom" mode the (visible) toolbar shows the title itself.
1977 if (isDesktopHideToolbar() && Display.getInstance().getCurrent() == this) { //NOPMD CompareObjectsWithEquals
1978 Display.getInstance().refreshNativeTitle();
1979 }
1980 return;
1981 }
1982
1983 this.title.setText(title);
1984
1985 if (!Display.getInstance().isNativeTitle()) {
1986 updateIcsIconCommandBehavior();
1987 if (isInitialized() && this.title.isTickerEnabled()) {
1988 int b = Display.getInstance().getCommandBehavior();
1989 if (b == Display.COMMAND_BEHAVIOR_BUTTON_BAR_TITLE_BACK || b == Display.COMMAND_BEHAVIOR_BUTTON_BAR_TITLE_RIGHT
1990 || b == Display.COMMAND_BEHAVIOR_ICS || b == Display.COMMAND_BEHAVIOR_SIDE_NAVIGATION) {
1991 titleArea.revalidateLater();
1992 }
1993 if (this.title.shouldTickerStart()) {
1994 this.title.startTicker(getUIManager().getLookAndFeel().getTickerSpeed(), true);
1995 } else {
1996 if (this.title.isTickerRunning()) {
1997 this.title.stopTicker();
1998 }
1999 }
2000 }
2001 } else {
2002 if (super.contains(titleArea)) {
2003 removeComponentFromForm(titleArea);
2004 }
2005 //if the Form is already displayed refresh the title
2006 if (Display.getInstance().getCurrent() == this) { //NOPMD CompareObjectsWithEquals
2007 Display.getInstance().refreshNativeTitle();
2008 }
2009 }
2010 }
2011
2012 /// Adds Component to the Form's Content Pane
2013 ///

Callers 15

FormMethod · 0.95
runTestMethod · 0.95
testUIFragmentMethod · 0.95
runMethod · 0.95
runMethod · 0.95
runMethod · 0.95
runMethod · 0.95
startMethod · 0.95

Calls 15

isDesktopHideToolbarMethod · 0.95
getInstanceMethod · 0.95
getUIManagerMethod · 0.95
isTickerEnabledMethod · 0.80
shouldTickerStartMethod · 0.80
getTickerSpeedMethod · 0.80
getLookAndFeelMethod · 0.80
isTickerRunningMethod · 0.80
setTitleMethod · 0.65
setTextMethod · 0.65