-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change single page design, now module links are displayed as tabs. Ad…
…d karaf logo in header, next to WebConsole text. git-svn-id: https://svn.apache.org/repos/asf/karaf/webconsole/trunk@1242787 13f79535-47bb-0310-9956-ffa450edef68
- Loading branch information
Showing
26 changed files
with
375 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
core/src/main/java/org/apache/karaf/webconsole/core/conventer/URIConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.karaf.webconsole.core.conventer; | ||
|
||
import java.net.URI; | ||
import java.net.URISyntaxException; | ||
import java.util.Locale; | ||
|
||
import org.apache.wicket.util.convert.converters.AbstractConverter; | ||
|
||
/** | ||
* URI converter. | ||
*/ | ||
public class URIConverter extends AbstractConverter { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
public Object convertToObject(String value, Locale locale) { | ||
try { | ||
return new URI(value); | ||
} catch (URISyntaxException e) { | ||
throw newConversionException("Illegal syntax: " + e.getReason(), value, locale); | ||
} catch (IllegalArgumentException e) { | ||
throw newConversionException("Invalid argument: " + e.getMessage(), value, locale); | ||
} | ||
} | ||
|
||
@Override | ||
protected Class<?> getTargetType() { | ||
return URI.class; | ||
} | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
core/src/main/java/org/apache/karaf/webconsole/core/conventer/URLConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.karaf.webconsole.core.conventer; | ||
|
||
import java.net.MalformedURLException; | ||
import java.net.URL; | ||
import java.util.Locale; | ||
|
||
import org.apache.wicket.util.convert.IConverter; | ||
import org.apache.wicket.util.convert.converters.AbstractConverter; | ||
|
||
/** | ||
* URI converter. | ||
*/ | ||
public class URLConverter extends AbstractConverter implements IConverter { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
public Object convertToObject(String value, Locale locale) { | ||
try { | ||
return new URL(value); | ||
} catch (MalformedURLException e) { | ||
throw newConversionException("Invalid syntax " + e.getMessage(), value, locale); | ||
} | ||
} | ||
|
||
@Override | ||
protected Class<?> getTargetType() { | ||
return URL.class; | ||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
.../src/main/java/org/apache/karaf/webconsole/core/conventer/WebConsoleConverterLocator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.karaf.webconsole.core.conventer; | ||
|
||
import java.net.URI; | ||
import java.net.URL; | ||
|
||
import org.apache.wicket.util.convert.ConverterLocator; | ||
|
||
/** | ||
* An extension of wicket base {@link ConverterLocator} which supports common | ||
* types used in Java. | ||
*/ | ||
public class WebConsoleConverterLocator extends ConverterLocator { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
public WebConsoleConverterLocator() { | ||
set(URI.class, new URIConverter()); | ||
set(URL.class, new URLConverter()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.