*/
private static String getPageLocationHtml(NavFrameOwner owner, NavAddress url) {
String separator = " >> ";
StringBuilder buffer = new StringBuilder();
CALFeatureMetadata metadata = NavAddressHelper.getMetadata(owner, url);
buffer.append("<table cellpadding='1' cellspacing='0' width='100%' bgcolor='#E0E0E0'><tr><td nowrap>");
buffer.append("<font size='3'><tt>");
buffer.append(getLinkHtml(NavAddress.getRootAddress(NavAddress.WORKSPACE_METHOD), NavigatorMessages.getString("NAV_Workspace_Location")));
buffer.append(separator);
if (url.getMethod() == NavAddress.SEARCH_METHOD) {
buffer.append(NavigatorMessages.getString("NAV_SearchResults_Location"));
} else if (url.getMethod() == NavAddress.COLLECTOR_METHOD) {
buffer.append(NavAddressHelper.getDisplayText(owner, url) + NavigatorMessages.getString("NAV_Collector_Location"));
} else if (url.getParameter(NavAddress.VAULT_PARAMETER) != null) {
// add link to module
buffer.append(getLinkHtml(url.withAllStripped(), NavAddressHelper.getDisplayText(owner, url.withAllStripped())));
buffer.append(separator);
// add a link to the vault
String vault = url.getParameter(NavAddress.VAULT_PARAMETER);
if (vault.equals(NavAddress.TYPE_VAULT_VALUE)) {
buffer.append(NavigatorMessages.getString("NAV_TypeVault_Location"));
} else if (vault.equals(NavAddress.CLASS_VAULT_VALUE)) {
buffer.append(NavigatorMessages.getString("NAV_ClassVault_Location"));
} else if (vault.equals(NavAddress.FUNCTION_VAULT_VALUE)) {
buffer.append(NavigatorMessages.getString("NAV_FunctionVault_Location"));
} else if (vault.equals(NavAddress.INSTANCE_VAULT_VALUE)) {
buffer.append(NavigatorMessages.getString("NAV_InstanceVault_Location"));
}
} else if (metadata instanceof ScopedEntityMetadata || metadata instanceof ClassInstanceMetadata || metadata instanceof InstanceMethodMetadata) {
String typeString = null;
CALFeatureName featureName = metadata.getFeatureName();
// add link to module
ModuleName moduleName = featureName.toModuleName();
MetaModule module = owner.getPerspective().getMetaModule(moduleName);
NavAddress moduleUrl = NavAddress.getAddress(module);
buffer.append(getLinkHtml(NavAddress.getAddress(module), moduleName.toSourceText()));
buffer.append(separator);
// add link to parent or vault
if (metadata instanceof FunctionMetadata) {
NavAddress vaultUrl = moduleUrl.withParameter(NavAddress.VAULT_PARAMETER, NavAddress.FUNCTION_VAULT_VALUE);
buffer.append(getLinkHtml(vaultUrl, NavigatorMessages.getString("NAV_FunctionVault_Location")));
typeString = NavigatorMessages.getString("NAV_Function_Location");
} else if (metadata instanceof TypeConstructorMetadata) {
NavAddress vaultUrl = moduleUrl.withParameter(NavAddress.VAULT_PARAMETER, NavAddress.TYPE_VAULT_VALUE);
buffer.append(getLinkHtml(vaultUrl, NavigatorMessages.getString("NAV_TypeVault_Location")));
typeString = NavigatorMessages.getString("NAV_Type_Location");
} else if (metadata instanceof TypeClassMetadata) {
NavAddress vaultUrl = moduleUrl.withParameter(NavAddress.VAULT_PARAMETER, NavAddress.CLASS_VAULT_VALUE);
buffer.append(getLinkHtml(vaultUrl, NavigatorMessages.getString("NAV_ClassVault_Location")));
typeString = NavigatorMessages.getString("NAV_Class_Location");
} else if (metadata instanceof ClassInstanceMetadata) {
NavAddress vaultUrl = moduleUrl.withParameter(NavAddress.VAULT_PARAMETER, NavAddress.INSTANCE_VAULT_VALUE);
buffer.append(getLinkHtml(vaultUrl, NavigatorMessages.getString("NAV_InstanceVault_Location")));
typeString = NavigatorMessages.getString("NAV_Instance_Location");
} else if (metadata instanceof InstanceMethodMetadata) {
CALFeatureName methodFeatureName = metadata.getFeatureName();
NavAddress parentUrl = NavAddress.getAddress(CALFeatureName.getClassInstanceFeatureName(
methodFeatureName.toInstanceIdentifier(), methodFeatureName.toModuleName()));
buffer.append(getLinkHtml(parentUrl, NavAddressHelper.getDisplayText(owner, parentUrl, ScopedEntityNamingPolicy.UNQUALIFIED)));
typeString = NavigatorMessages.getString("NAV_InstanceMethod_Location");