This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Setting custom main window title doesn't work in Platform app with project.ui included (was: Refresh of Main Window Title is cumbersome) | ||
---|---|---|---|
Product: | projects | Reporter: | ngx472 <ngx472> |
Component: | Generic Projects UI | Assignee: | Jesse Glick <jglick> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | saubrecht |
Priority: | P3 | Keywords: | API |
Version: | 6.x | ||
Hardware: | PC | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | 199245 | ||
Bug Blocks: |
Description
ngx472
2008-05-10 11:27:15 UTC
Do you really need the whole hack? shouldn't this be enough ? ->WindowManager.getDefault().getMainWindow().setTitle(title); I am not sure I get your point. When I program a setTitle in my componentActivated, the title blinks and then gets updated 1/2 second later with the module title, which is not exactly what I want. How can prevent netbeans from deciding what title the mainWindow should have? Alternatively, how do I set the string that serves as the main window title? Tks! (Precision: I need to set the window title with values that are known at runtime and not at build time) Tks I'm reopening, it is valid and nasty defect, should be fixed better sooner then later IMHO - although there is WindowManager.getDefault().getMainWindow().setTitle(title), it doesn't work as expected. AFAIK there is a little problem that we don't want modules to call methods on WindowManager.getDefault().getMainWindow() directly, but we made an error in API designing in past, method is here so we can't stop modules from calling into main window directly. I see two possible solutions: a) Make hack in projects ui more clever and somehow stop setting main window title if other clients starts to call WindowManager.getDefault().getMainWindow().setTitle(title). Cooperation between projects.ui and core/window system would be needed to achieve this (through main window JFrame's client property friend API I think). b) Add API to projectui API to enable/disable current project's behavior. In either way, javadoc for WindowManager.getDefault().getMainWindow() should be improved and explain what to do if custom window title is desired. Note that IMHO it is not good to add any naming API to window system, because as I said we can't stop anybody from calling WindowManager.getDefault().getMainWindow().setTitle(title) and break any naming mechanism down. Fixable by just suppressing the MW title update when it seems to be changing behind our backs. core-main #d3f79853b99f Integrated into 'main-golden', will be available in build *201004090201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/d3f79853b99f User: Jesse Glick <jglick@netbeans.org> Log: #134802: Setting custom main window title doesn't work in Platform app with project.ui included (was: Refresh of Main Window Title is cumbersome) |