panel.getTabs().clear();
if (userSelecteed)
{
if (principalType.getName().equals(JetspeedPrincipalType.USER))
{
tab = new AbstractTab(new Model("User Profile"))
{
public Panel getPanel(String panelId)
{
return new UserPrincipalProfilePanel(panelId);
}
};
} else
{
tab = new AbstractTab(new Model("User Profile"))
{
public Panel getPanel(String panelId)
{
return new PrincipalProfilePanel(panelId);
}
};
}
panel.getTabs().add(tab);
tab = new AbstractTab(new Model("Associations"))
{
public Panel getPanel(String panelId)
{
return new PrincipalAssociationsPanel(panelId);
}
};
panel.getTabs().add(tab);
tab = new AbstractTab(new Model("Attributes"))
{
public Panel getPanel(String panelId)
{
return new PrincipalAttributesPanel(panelId);
}
};
panel.getTabs().add(tab);
if (principalType.getName().equals(JetspeedPrincipalType.USER))
{
tab = new AbstractTab(new Model("Credentials"))
{
public Panel getPanel(String panelId)
{
return new PrincipalCredentialsPanel(panelId);
}
};
panel.getTabs().add(tab);
}
panel.setSelectedTab(0);
} else
{
if (principalType.getName().equals(JetspeedPrincipalType.USER))
{
tab = new AbstractTab(new Model("New "
+ principalType.getName().toUpperCase()))
{
public Panel getPanel(String panelId)
{
return new NewUserPrincipalPanel(panelId);
}
};
} else
{
tab = new AbstractTab(new Model("New "
+ principalType.getName().toUpperCase()))
{
public Panel getPanel(String panelId)
{