MCPcopy Create free account
hub / github.com/PCGen/pcgen / updateTitle

Method updateTitle

code/src/java/pcgen/gui2/PCGenFrame.java:1252–1291  ·  view source on GitHub ↗

Set the frame's title based on the current character and source/game mode.

()

Source from the content-addressed store, hash-verified

1250 * Set the frame's title based on the current character and source/game mode.
1251 */
1252 private void updateTitle()
1253 {
1254 StringBuilder title = new StringBuilder(100);
1255 File characterFile;
1256 String characterFileName = null;
1257 String sourceName = null;
1258 if (currentCharacterRef != null && currentCharacterRef.get() != null)
1259 {
1260 // characterFileName The file name (without path) of the active character
1261 // sourceName The name of the source selection.
1262
1263 characterFile = currentCharacterRef.get().getFileRef().get();
1264 if (characterFile == null || StringUtils.isEmpty(characterFile.getName()))
1265 {
1266 characterFileName = LanguageBundle.getString("in_unsaved_char"); //$NON-NLS-1$
1267 }
1268 else
1269 {
1270 characterFileName = characterFile.getName();
1271 }
1272 }
1273 if (currentSourceSelection.get() != null)
1274 {
1275 sourceName = currentSourceSelection.get().toString();
1276 }
1277
1278 if (characterFileName != null && !characterFileName.isEmpty())
1279 {
1280 title.append(characterFileName);
1281 title.append(" - ");
1282 }
1283 if (sourceName != null && !sourceName.isEmpty())
1284 {
1285 title.append(sourceName);
1286 title.append(" - ");
1287 }
1288 title.append("PCGen v");
1289 title.append(PCGenPropBundle.getVersionNumber());
1290 setTitle(title.toString());
1291 }
1292
1293 /**
1294 * display the tips of the day dialog to the user

Callers 5

initComponentsMethod · 0.95
setCharacterMethod · 0.95
unloadSourcesMethod · 0.95
runMethod · 0.80
referenceChangedMethod · 0.80

Calls 9

getStringMethod · 0.95
getVersionNumberMethod · 0.95
getMethod · 0.65
getFileRefMethod · 0.65
isEmptyMethod · 0.65
getNameMethod · 0.65
toStringMethod · 0.65
setTitleMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected