ccm-shortcuts: Some reformatting of sources
Foundry: Added an additional selector for selecting the template for a portlet git-svn-id: https://svn.libreccm.org/ccm/trunk@3704 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
e998131935
commit
375b78c3bd
|
|
@ -139,6 +139,9 @@
|
|||
<xsl:variable name="classname">
|
||||
<xsl:value-of select="./@bebop:classname"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="title">
|
||||
<xsl:value-of select="./@title"/>
|
||||
</xsl:variable>
|
||||
|
||||
<!--<pre>
|
||||
<xsl:value-of select="concat('portlet-class = ', ./@bebop:classname)"/>
|
||||
|
|
@ -151,6 +154,11 @@
|
|||
</pre>-->
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="$template-map/portlet[@class=$classname and @workspace = $workspace and @title=$title]">
|
||||
<xsl:apply-templates select="document(foundry:gen-path(concat('templates/', normalize-space($template-map/portlet[@class=$classname and @workspace=$workspace and @title=$title]))))/*">
|
||||
<xsl:with-param name="portlet-data-tree" tunnel="yes" select="current()"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:when>
|
||||
<xsl:when test="$template-map/portlet[@class=$classname and @workspace = $workspace]">
|
||||
<xsl:apply-templates select="document(foundry:gen-path(concat('templates/', normalize-space($template-map/portlet[@class=$classname and @workspace=$workspace]))))/*">
|
||||
<xsl:with-param name="portlet-data-tree" tunnel="yes" select="current()"/>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
* rights and limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.shortcuts.ui;
|
||||
|
||||
import org.apache.log4j.Category;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.shortcuts.ui;
|
||||
|
||||
import com.arsdigita.bebop.Table;
|
||||
|
|
@ -47,10 +46,11 @@ import com.arsdigita.bebop.ExternalLink;
|
|||
*
|
||||
*/
|
||||
public class ShortcutsTable extends Table {
|
||||
private static final Category log =
|
||||
Category.getInstance(ShortcutsTable.class.getName());
|
||||
|
||||
public static final String headers[] = { "URL Key", "Redirect", "", "" };
|
||||
private static final Category log = Category.getInstance(
|
||||
ShortcutsTable.class.getName());
|
||||
|
||||
public static final String headers[] = {"URL Key", "Redirect", "", ""};
|
||||
|
||||
public ShortcutsTable(final ACSObjectSelectionModel selected_shortcut) {
|
||||
super(new ShortcutsModelBuilder(), headers);
|
||||
|
|
@ -58,6 +58,7 @@ public class ShortcutsTable extends Table {
|
|||
setDefaultCellRenderer(new ShortcutsCellRenderer());
|
||||
|
||||
addTableActionListener(new TableActionListener() {
|
||||
|
||||
public void cellSelected(TableActionEvent e) {
|
||||
selected_shortcut.clearSelection(e.getPageState());
|
||||
String row = (String) e.getRowKey();
|
||||
|
|
@ -65,7 +66,8 @@ public class ShortcutsTable extends Table {
|
|||
// edit selected
|
||||
log.debug("selected edit shortcut " + row);
|
||||
try {
|
||||
selected_shortcut.setSelectedKey(e.getPageState(), new BigDecimal(row));
|
||||
selected_shortcut.setSelectedKey(e.getPageState(),
|
||||
new BigDecimal(row));
|
||||
} catch (DataObjectNotFoundException ex) {
|
||||
throw new UncheckedWrapperException(
|
||||
"cannot find shortcut", ex);
|
||||
|
|
@ -87,6 +89,7 @@ public class ShortcutsTable extends Table {
|
|||
|
||||
public void headSelected(TableActionEvent e) {
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -98,6 +101,7 @@ public class ShortcutsTable extends Table {
|
|||
}
|
||||
|
||||
protected class ShortcutsModel implements TableModel {
|
||||
|
||||
private ShortcutCollection m_shortcuts;
|
||||
|
||||
private Shortcut m_shortcut;
|
||||
|
|
@ -126,12 +130,16 @@ public class ShortcutsTable extends Table {
|
|||
BigDecimal id = m_shortcut.getID();
|
||||
return id;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected static class ShortcutsCellRenderer implements TableCellRenderer {
|
||||
|
||||
public Component getComponent(Table table, PageState state,
|
||||
Object value, boolean isSelected, Object key, int row,
|
||||
Object value, boolean isSelected,
|
||||
Object key, int row,
|
||||
int column) {
|
||||
Shortcut shortcut = (Shortcut) value;
|
||||
|
||||
|
|
@ -150,5 +158,7 @@ public class ShortcutsTable extends Table {
|
|||
throw new UncheckedWrapperException("Column out of bounds");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue