rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
new GConstructorInfo(constructorArgs),
new GConstructorInfo(serviceFactory.getConstructorArgNames()),
public static GBeanInfo createGBeanInfo(GBeanDefinition gBeanDefinition) { // add the normal properties Set attributeInfos = new HashSet(); PropertyValue[] properties = gBeanDefinition.getPropertyValues().getPropertyValues(); for (int i = 0; i < properties.length; i++) { PropertyValue propertyValue = properties[i]; attributeInfos.add(new GAttributeInfo(propertyValue.getName(), "java.lang.Object", true, null, null)); } // add the dynamic properties PropertyValue[] dynamicProperties = gBeanDefinition.getDynamicPropertyValues().getPropertyValues(); for (int i = 0; i < dynamicProperties.length; i++) { PropertyValue dynamicPropertyValue = dynamicProperties[i]; attributeInfos.add(new DynamicGAttributeInfo(dynamicPropertyValue.getName(), "java.lang.Object", true, true, true)); } // add the constructor arguments int maxIndex = -1; for (Iterator iterator = gBeanDefinition.getConstructorArgumentValues().getIndexedArgumentValues().keySet().iterator(); iterator.hasNext();) { int index = ((Integer) iterator.next()).intValue(); if (index > maxIndex) maxIndex = index; } String[] constructorArgs = new String[maxIndex + 1]; for (Iterator iterator = gBeanDefinition.getConstructorArgumentValues().getIndexedArgumentValues().entrySet().iterator(); iterator.hasNext();) { Map.Entry entry = (Map.Entry) iterator.next(); int index = ((Integer) entry.getKey()).intValue(); ConstructorArgumentValues.ValueHolder valueHolder = (ConstructorArgumentValues.ValueHolder) entry.getValue(); String constructorArgName; if (valueHolder instanceof NamedValueHolder) { NamedValueHolder namedValueHolder = (NamedValueHolder) valueHolder; constructorArgName = namedValueHolder.getName(); } else { constructorArgName = "constructor-argument-" + index; } attributeInfos.add(new GAttributeInfo(constructorArgName, valueHolder.getType(), true, null, null)); constructorArgs[index] = constructorArgName; } // add the dependencies Set referenceInfos = new HashSet(); String[] dependsOn = gBeanDefinition.getDependsOn(); for (int i = 0; i < dependsOn.length; i++) { Map map = stringToDependency(dependsOn[i]); String dependencyName = (String) map.keySet().iterator().next(); referenceInfos.add(new GReferenceInfo("@" + dependencyName, DependencyOnly.class.getName(), DependencyOnly.class.getName(), null, null)); } return new GBeanInfo(gBeanDefinition.getBeanClassName(), "GBean", attributeInfos, new GConstructorInfo(constructorArgs), Collections.EMPTY_SET, referenceInfos); }
referenceInfos);
null);
public static GBeanInfo createGBeanInfo(GBeanDefinition gBeanDefinition) { // add the normal properties Set attributeInfos = new HashSet(); PropertyValue[] properties = gBeanDefinition.getPropertyValues().getPropertyValues(); for (int i = 0; i < properties.length; i++) { PropertyValue propertyValue = properties[i]; attributeInfos.add(new GAttributeInfo(propertyValue.getName(), "java.lang.Object", true, null, null)); } // add the dynamic properties PropertyValue[] dynamicProperties = gBeanDefinition.getDynamicPropertyValues().getPropertyValues(); for (int i = 0; i < dynamicProperties.length; i++) { PropertyValue dynamicPropertyValue = dynamicProperties[i]; attributeInfos.add(new DynamicGAttributeInfo(dynamicPropertyValue.getName(), "java.lang.Object", true, true, true)); } // add the constructor arguments int maxIndex = -1; for (Iterator iterator = gBeanDefinition.getConstructorArgumentValues().getIndexedArgumentValues().keySet().iterator(); iterator.hasNext();) { int index = ((Integer) iterator.next()).intValue(); if (index > maxIndex) maxIndex = index; } String[] constructorArgs = new String[maxIndex + 1]; for (Iterator iterator = gBeanDefinition.getConstructorArgumentValues().getIndexedArgumentValues().entrySet().iterator(); iterator.hasNext();) { Map.Entry entry = (Map.Entry) iterator.next(); int index = ((Integer) entry.getKey()).intValue(); ConstructorArgumentValues.ValueHolder valueHolder = (ConstructorArgumentValues.ValueHolder) entry.getValue(); String constructorArgName; if (valueHolder instanceof NamedValueHolder) { NamedValueHolder namedValueHolder = (NamedValueHolder) valueHolder; constructorArgName = namedValueHolder.getName(); } else { constructorArgName = "constructor-argument-" + index; } attributeInfos.add(new GAttributeInfo(constructorArgName, valueHolder.getType(), true, null, null)); constructorArgs[index] = constructorArgName; } // add the dependencies Set referenceInfos = new HashSet(); String[] dependsOn = gBeanDefinition.getDependsOn(); for (int i = 0; i < dependsOn.length; i++) { Map map = stringToDependency(dependsOn[i]); String dependencyName = (String) map.keySet().iterator().next(); referenceInfos.add(new GReferenceInfo("@" + dependencyName, DependencyOnly.class.getName(), DependencyOnly.class.getName(), null, null)); } return new GBeanInfo(gBeanDefinition.getBeanClassName(), "GBean", attributeInfos, new GConstructorInfo(constructorArgs), Collections.EMPTY_SET, referenceInfos); }
if (file.isDirectory())
if (isClass(file)) { addInstrumentationToSingleClass(file); } else if (file.isDirectory())
private void addInstrumentation(File file) { if (file.isDirectory()) { File[] contents = file.listFiles(); for (int i = 0; i < contents.length; i++) addInstrumentation(contents[i]); return; } if (!isClass(file)) { return; } if (logger.isDebugEnabled()) { logger.debug("instrumenting " + file.getAbsolutePath()); } InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(projectData, cw, ignoreRegexp); cr.accept(cv, false); } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
return;
private void addInstrumentation(File file) { if (file.isDirectory()) { File[] contents = file.listFiles(); for (int i = 0; i < contents.length; i++) addInstrumentation(contents[i]); return; } if (!isClass(file)) { return; } if (logger.isDebugEnabled()) { logger.debug("instrumenting " + file.getAbsolutePath()); } InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(projectData, cw, ignoreRegexp); cr.accept(cv, false); } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
if (!isClass(file))
else if (isArchive(file))
private void addInstrumentation(File file) { if (file.isDirectory()) { File[] contents = file.listFiles(); for (int i = 0; i < contents.length; i++) addInstrumentation(contents[i]); return; } if (!isClass(file)) { return; } if (logger.isDebugEnabled()) { logger.debug("instrumenting " + file.getAbsolutePath()); } InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(projectData, cw, ignoreRegexp); cr.accept(cv, false); } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
return; } if (logger.isDebugEnabled()) { logger.debug("instrumenting " + file.getAbsolutePath()); } InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(projectData, cw, ignoreRegexp); cr.accept(cv, false); } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } }
addInstrumentationToArchive(file);
private void addInstrumentation(File file) { if (file.isDirectory()) { File[] contents = file.listFiles(); for (int i = 0; i < contents.length; i++) addInstrumentation(contents[i]); return; } if (!isClass(file)) { return; } if (logger.isDebugEnabled()) { logger.debug("instrumenting " + file.getAbsolutePath()); } InputStream inputStream = null; ClassWriter cw; ClassInstrumenter cv; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); cw = new ClassWriter(true); cv = new ClassInstrumenter(projectData, cw, ignoreRegexp); cr.accept(cv, false); } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } } OutputStream outputStream = null; try { if (cv.isInstrumented()) { // If destinationDirectory is null, then overwrite // the original, uninstrumented file. File outputFile; if (destinationDirectory == null) outputFile = file; else outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); } byte[] instrumentedClass = cw.toByteArray(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); return; } finally { if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
Pattern ignoreRegexp)
final Collection ignoreRegexs)
public ClassInstrumenter(ProjectData projectData, final ClassVisitor cv, Pattern ignoreRegexp) { super(cv); this.projectData = projectData; this.ignoreRegex = ignoreRegexp; }
this.ignoreRegex = ignoreRegexp;
this.ignoreRegexs = ignoreRegexs;
public ClassInstrumenter(ProjectData projectData, final ClassVisitor cv, Pattern ignoreRegexp) { super(cv); this.projectData = projectData; this.ignoreRegex = ignoreRegexp; }
String message = "Your connection was closed due to an error.";
String message = Res.getString("message.disconnected.error");
public void connectionClosedOnError(final Exception ex) { SwingUtilities.invokeLater(new Runnable() { public void run() { Log.error("Connection closed on error.", ex); String message = "Your connection was closed due to an error."; if (ex instanceof XMPPException) { XMPPException xmppEx = (XMPPException)ex; StreamError error = xmppEx.getStreamError(); String reason = error.getCode(); if ("conflict".equals(reason)) { message = "Your connection was closed due to the same user logging in from another location."; } } Collection rooms = SparkManager.getChatManager().getChatContainer().getChatRooms(); Iterator iter = rooms.iterator(); while (iter.hasNext()) { ChatRoom chatRoom = (ChatRoom)iter.next(); chatRoom.getChatInputEditor().setEnabled(false); chatRoom.getSendButton().setEnabled(false); chatRoom.getTranscriptWindow().insertNotificationMessage(message); } } }); }
message = "Your connection was closed due to the same user logging in from another location.";
message = Res.getString("message.disconnected.conflict.error");
public void connectionClosedOnError(final Exception ex) { SwingUtilities.invokeLater(new Runnable() { public void run() { Log.error("Connection closed on error.", ex); String message = "Your connection was closed due to an error."; if (ex instanceof XMPPException) { XMPPException xmppEx = (XMPPException)ex; StreamError error = xmppEx.getStreamError(); String reason = error.getCode(); if ("conflict".equals(reason)) { message = "Your connection was closed due to the same user logging in from another location."; } } Collection rooms = SparkManager.getChatManager().getChatContainer().getChatRooms(); Iterator iter = rooms.iterator(); while (iter.hasNext()) { ChatRoom chatRoom = (ChatRoom)iter.next(); chatRoom.getChatInputEditor().setEnabled(false); chatRoom.getSendButton().setEnabled(false); chatRoom.getTranscriptWindow().insertNotificationMessage(message); } } }); }
String message = "Your connection was closed due to an error.";
String message = Res.getString("message.disconnected.error");
public void run() { Log.error("Connection closed on error.", ex); String message = "Your connection was closed due to an error."; if (ex instanceof XMPPException) { XMPPException xmppEx = (XMPPException)ex; StreamError error = xmppEx.getStreamError(); String reason = error.getCode(); if ("conflict".equals(reason)) { message = "Your connection was closed due to the same user logging in from another location."; } } Collection rooms = SparkManager.getChatManager().getChatContainer().getChatRooms(); Iterator iter = rooms.iterator(); while (iter.hasNext()) { ChatRoom chatRoom = (ChatRoom)iter.next(); chatRoom.getChatInputEditor().setEnabled(false); chatRoom.getSendButton().setEnabled(false); chatRoom.getTranscriptWindow().insertNotificationMessage(message); } }
message = "Your connection was closed due to the same user logging in from another location.";
message = Res.getString("message.disconnected.conflict.error");
public void run() { Log.error("Connection closed on error.", ex); String message = "Your connection was closed due to an error."; if (ex instanceof XMPPException) { XMPPException xmppEx = (XMPPException)ex; StreamError error = xmppEx.getStreamError(); String reason = error.getCode(); if ("conflict".equals(reason)) { message = "Your connection was closed due to the same user logging in from another location."; } } Collection rooms = SparkManager.getChatManager().getChatContainer().getChatRooms(); Iterator iter = rooms.iterator(); while (iter.hasNext()) { ChatRoom chatRoom = (ChatRoom)iter.next(); chatRoom.getChatInputEditor().setEnabled(false); chatRoom.getSendButton().setEnabled(false); chatRoom.getTranscriptWindow().insertNotificationMessage(message); } }
p.setStatus("User has locked their workstation.");
p.setStatus(Res.getString("message.locked.workstation"));
private void setIdleListener() throws Exception { final Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { LocalPreferences localPref = SettingsManager.getLocalPreferences(); int delay = 0; if (localPref.isIdleOn()) { delay = localPref.getIdleTime() * 60000; } else { return; } long idleTime = SystemInfo.getSessionIdleTime(); boolean isLocked = SystemInfo.isSessionLocked(); if (idleTime > delay) { try { // Handle if spark is not connected to the server. if (SparkManager.getConnection() == null || !SparkManager.getConnection().isConnected()) { return; } // Change Status Workspace workspace = SparkManager.getWorkspace(); Presence presence = workspace.getStatusBar().getPresence(); if (workspace != null && presence.getMode() == Presence.Mode.available) { unavaliable = true; StatusItem away = workspace.getStatusBar().getStatusItem("Away"); Presence p = away.getPresence(); if (isLocked) { p.setStatus("User has locked their workstation."); } else { p.setStatus("Away due to idle."); } previousPriority = presence.getPriority(); p.setPriority(0); SparkManager.getSessionManager().changePresence(p); } } catch (Exception e) { Log.error("Error with IDLE status.", e); timer.cancel(); } } else { if (unavaliable) { setAvailableIfActive(); } } } }, 1000, 1000); }
p.setStatus("Away due to idle.");
p.setStatus(Res.getString("message.away.idle"));
private void setIdleListener() throws Exception { final Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { LocalPreferences localPref = SettingsManager.getLocalPreferences(); int delay = 0; if (localPref.isIdleOn()) { delay = localPref.getIdleTime() * 60000; } else { return; } long idleTime = SystemInfo.getSessionIdleTime(); boolean isLocked = SystemInfo.isSessionLocked(); if (idleTime > delay) { try { // Handle if spark is not connected to the server. if (SparkManager.getConnection() == null || !SparkManager.getConnection().isConnected()) { return; } // Change Status Workspace workspace = SparkManager.getWorkspace(); Presence presence = workspace.getStatusBar().getPresence(); if (workspace != null && presence.getMode() == Presence.Mode.available) { unavaliable = true; StatusItem away = workspace.getStatusBar().getStatusItem("Away"); Presence p = away.getPresence(); if (isLocked) { p.setStatus("User has locked their workstation."); } else { p.setStatus("Away due to idle."); } previousPriority = presence.getPriority(); p.setPriority(0); SparkManager.getSessionManager().changePresence(p); } } catch (Exception e) { Log.error("Error with IDLE status.", e); timer.cancel(); } } else { if (unavaliable) { setAvailableIfActive(); } } } }, 1000, 1000); }
p.setStatus("User has locked their workstation.");
p.setStatus(Res.getString("message.locked.workstation"));
public void run() { LocalPreferences localPref = SettingsManager.getLocalPreferences(); int delay = 0; if (localPref.isIdleOn()) { delay = localPref.getIdleTime() * 60000; } else { return; } long idleTime = SystemInfo.getSessionIdleTime(); boolean isLocked = SystemInfo.isSessionLocked(); if (idleTime > delay) { try { // Handle if spark is not connected to the server. if (SparkManager.getConnection() == null || !SparkManager.getConnection().isConnected()) { return; } // Change Status Workspace workspace = SparkManager.getWorkspace(); Presence presence = workspace.getStatusBar().getPresence(); if (workspace != null && presence.getMode() == Presence.Mode.available) { unavaliable = true; StatusItem away = workspace.getStatusBar().getStatusItem("Away"); Presence p = away.getPresence(); if (isLocked) { p.setStatus("User has locked their workstation."); } else { p.setStatus("Away due to idle."); } previousPriority = presence.getPriority(); p.setPriority(0); SparkManager.getSessionManager().changePresence(p); } } catch (Exception e) { Log.error("Error with IDLE status.", e); timer.cancel(); } } else { if (unavaliable) { setAvailableIfActive(); } } }
p.setStatus("Away due to idle.");
p.setStatus(Res.getString("message.away.idle"));
public void run() { LocalPreferences localPref = SettingsManager.getLocalPreferences(); int delay = 0; if (localPref.isIdleOn()) { delay = localPref.getIdleTime() * 60000; } else { return; } long idleTime = SystemInfo.getSessionIdleTime(); boolean isLocked = SystemInfo.isSessionLocked(); if (idleTime > delay) { try { // Handle if spark is not connected to the server. if (SparkManager.getConnection() == null || !SparkManager.getConnection().isConnected()) { return; } // Change Status Workspace workspace = SparkManager.getWorkspace(); Presence presence = workspace.getStatusBar().getPresence(); if (workspace != null && presence.getMode() == Presence.Mode.available) { unavaliable = true; StatusItem away = workspace.getStatusBar().getStatusItem("Away"); Presence p = away.getPresence(); if (isLocked) { p.setStatus("User has locked their workstation."); } else { p.setStatus("Away due to idle."); } previousPriority = presence.getPriority(); p.setPriority(0); SparkManager.getSessionManager().changePresence(p); } } catch (Exception e) { Log.error("Error with IDLE status.", e); timer.cancel(); } } else { if (unavaliable) { setAvailableIfActive(); } } }
Iterator iter = dndList.iterator();
Iterator iter = statusList.iterator();
public StatusItem getStatusItem(String label) { Iterator iter = dndList.iterator(); while (iter.hasNext()) { StatusItem item = (StatusItem)iter.next(); if (item.getText().equals(label)) { return item; } } return null; }
dumpClasses((Clazz[])pack.getClasses().toArray( new Clazz[pack.getClasses().size()]));
dumpClasses((Clazz[])pack.getClasses().toArray(new Clazz[pack.getClasses().size()])); decreaseIndentation(); println("</package>");
private void dumpPackage(Package pack) { println("<package name=\"" + pack.getName() + "\"" + " line-rate=\"" + pack.getLineCoverageRate() + "\"" + " branch-rate=\"" + pack.getBranchCoverageRate() + "\"" + ">"); increaseIndentation(); dumpClasses((Clazz[])pack.getClasses().toArray( new Clazz[pack.getClasses().size()])); }
private void dumpPackages(Coverage coverage)
private void dumpPackages(CoverageReport coverage)
private void dumpPackages(Coverage coverage) { Iterator it = coverage.getPackages().iterator(); while (it.hasNext()) { dumpPackage((Package)it.next()); } }
if (numberOfLines == 0)
if (getNumberOfLines() == 0)
public double getLineCoverageRate() { if (numberOfLines == 0) { return 1; } return (double)numberOfCoveredLines / (double)numberOfLines; }
return (double)numberOfCoveredLines / (double)numberOfLines;
return (double)getNumberOfCoveredLines() / (double)getNumberOfLines();
public double getLineCoverageRate() { if (numberOfLines == 0) { return 1; } return (double)numberOfCoveredLines / (double)numberOfLines; }
if (numberOfBranches == 0)
if (getNumberOfBranches() == 0)
public double getBranchCoverageRate() { if (numberOfBranches == 0) { if (numberOfCoveredLines == 0) { return 0; } return 1; } return (double)numberOfCoveredBranches / (double)numberOfBranches; }
if (numberOfCoveredLines == 0)
if (getNumberOfCoveredLines() == 0)
public double getBranchCoverageRate() { if (numberOfBranches == 0) { if (numberOfCoveredLines == 0) { return 0; } return 1; } return (double)numberOfCoveredBranches / (double)numberOfBranches; }
return (double)numberOfCoveredBranches / (double)numberOfBranches;
return (double)getNumberOfCoveredBranches() / (double)getNumberOfBranches();
public double getBranchCoverageRate() { if (numberOfBranches == 0) { if (numberOfCoveredLines == 0) { return 0; } return 1; } return (double)numberOfCoveredBranches / (double)numberOfBranches; }
Log.error("Unable to load plugin " + name + " due to min version incompatibility.");
public Collection getPluginList(InputStream response) { final List pluginList = new ArrayList(); SAXReader saxReader = new SAXReader(); Document pluginXML = null; try { pluginXML = saxReader.read(response); } catch (DocumentException e) { Log.error(e); } List plugins = pluginXML.selectNodes("/plugins/plugin"); Iterator iter = plugins.iterator(); while (iter.hasNext()) { PublicPlugin publicPlugin = new PublicPlugin(); String clazz = null; String name = null; try { Element plugin = (Element)iter.next(); try { String version = plugin.selectSingleNode("minSparkVersion").getText(); if (version.compareTo(JiveInfo.getVersion()) < 1) { continue; } } catch (Exception e) { Log.error("Unable to load plugin " + name + " due to no minSparkVersion."); continue; } name = plugin.selectSingleNode("name").getText(); clazz = plugin.selectSingleNode("class").getText(); publicPlugin.setPluginClass(clazz); publicPlugin.setName(name); try { String version = plugin.selectSingleNode("version").getText(); publicPlugin.setVersion(version); String author = plugin.selectSingleNode("author").getText(); publicPlugin.setAuthor(author); Node emailNode = plugin.selectSingleNode("email"); if (emailNode != null) { publicPlugin.setEmail(emailNode.getText()); } Node descriptionNode = plugin.selectSingleNode("description"); if (descriptionNode != null) { publicPlugin.setDescription(descriptionNode.getText()); } Node homePageNode = plugin.selectSingleNode("homePage"); if (homePageNode != null) { publicPlugin.setHomePage(homePageNode.getText()); } Node downloadNode = plugin.selectSingleNode("downloadURL"); if (downloadNode != null) { String downloadURL = downloadNode.getText(); publicPlugin.setDownloadURL(downloadURL); } Node changeLog = plugin.selectSingleNode("changeLog"); if (changeLog != null) { publicPlugin.setChangeLogAvailable(true); } Node readMe = plugin.selectSingleNode("readme"); if (readMe != null) { publicPlugin.setReadMeAvailable(true); } Node smallIcon = plugin.selectSingleNode("smallIcon"); if (smallIcon != null) { publicPlugin.setSmallIconAvailable(true); } Node largeIcon = plugin.selectSingleNode("largeIcon"); if (largeIcon != null) { publicPlugin.setLargeIconAvailable(true); } } catch (Exception e) { System.out.println("We can ignore these."); } pluginList.add(publicPlugin); } catch (Exception ex) { ex.printStackTrace(); } } return pluginList; }
return "1.1.9.2";
return "1.1.9.3";
public static String getVersion() { return "1.1.9.2"; }
String scope = ArticleUtil.getArticleRootPath();
String scope = ArticleUtil.getArticleBaseFolderPath();
public List listArticles() throws XmlException, IOException{ List list = new ArrayList(); IWContext iwc = IWContext.getInstance(); try { String scope = ArticleUtil.getArticleRootPath(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwc,IWSlideSession.class); if(scope != null){ if(scope.startsWith(session.getWebdavServerURI())){ scope = scope.substring(session.getWebdavServerURI().length()); } if(scope.startsWith("/")){ scope = scope.substring(1); } } ContentSearch searchBusiness = new ContentSearch(iwc.getIWMainApplication()); Search search = searchBusiness.createSearch(getSearchRequest(scope, iwc.getCurrentLocale())); Collection results = search.getSearchResults(); if(results!=null){ for (Iterator iter = results.iterator(); iter.hasNext();) { SearchResult result = (SearchResult) iter.next(); try { System.out.println("Attempting to load "+result.getSearchResultURI()); ArticleItemBean article = new ArticleSearchResultBean(); article.load(result.getSearchResultURI()); list.add(article); }catch(Exception e) { e.printStackTrace(); } } } } catch (SearchException e1) { e1.printStackTrace(); } return list; }
assertStringTemplateEquals ("#if(true){ pass }", " pass ");
public void testAfterBegin () throws Exception { assertStringTemplateEquals ("#if(true)#begin \npass#end", "pass"); assertStringTemplateEquals ("#if(true)#begin \n pass#end", " pass"); assertStringTemplateEquals ("#if(true)#begin pass#end", " pass"); assertStringTemplateEquals ("#if(true)#begin pass#end", "pass"); assertStringTemplateEquals ("#if(true) {pass}", "pass"); assertStringTemplateEquals ("#if(true){ pass}", " pass"); assertStringTemplateEquals ("#if(true){\n pass}", " pass"); assertStringTemplateEquals ("#if(true){ \n pass}", " pass"); assertStringTemplateEquals ("#if(true){ \npass}", "pass"); assertStringTemplateEquals ("#if(true) \npass #end", "pass"); assertStringTemplateEquals ("#if(true) pass #end", "pass"); assertStringTemplateEquals ("#if(true) \n pass #end", " pass"); }
File[] files = finder.findDirectory(packageData.getSourceFileName()); if (files.length == 0) { LOGGER.warn("No directories found for package: " + packageData.getSourceFileName()); } double ccnSum = 0; for (int i = 0; i < files.length; i++) { ccnSum += Util.getCCN(files[i], false); } double ccn = ccnSum / (double) files.length;
double ccn = packageData.getCCN(finder);
private String generateTableRowForPackage(PackageData packageData) { StringBuffer ret = new StringBuffer(); String url1 = "frame-summary-" + packageData.getName() + ".html"; String url2 = "frame-sourcefiles-" + packageData.getName() + ".html"; double lineCoverage = -1; double branchCoverage = -1; File[] files = finder.findDirectory(packageData.getSourceFileName()); if (files.length == 0) { LOGGER.warn("No directories found for package: " + packageData.getSourceFileName()); } double ccnSum = 0; for (int i = 0; i < files.length; i++) { ccnSum += Util.getCCN(files[i], false); } double ccn = ccnSum / (double) files.length; if (packageData.getNumberOfValidLines() > 0) lineCoverage = packageData.getLineCoverageRate(); if (packageData.getNumberOfValidBranches() > 0) branchCoverage = packageData.getBranchCoverageRate(); ret.append(" <tr>"); ret.append("<td class=\"text\"><a href=\"" + url1 + "\" onClick='parent.sourceFileList.location.href=\"" + url2 + "\"'>" + generatePackageName(packageData) + "</a></td>"); ret.append("<td class=\"value\">" + packageData.getNumberOfChildren() + "</td>"); ret.append(generateTableColumnsFromData(lineCoverage, branchCoverage, ccn)); ret.append("</tr>"); return ret.toString(); }
public HSV(float hs, float ss, float vs, float as)
public HSV()
public HSV(float hs, float ss, float vs, float as) { h = hs; s = ss; v = vs; a = as; }
h = hs; s = ss; v = vs; a = as;
h = 0; s = 0; v = 0; a = 0;
public HSV(float hs, float ss, float vs, float as) { h = hs; s = ss; v = vs; a = as; }
public NoteTreeNode(Tree parent, Note data) { treeItem = new TreeItem(parent, SWT.NONE);
public NoteTreeNode(NoteTreeNode parent, DisplayedNote data) { treeItem = new TreeItem(parent.treeItem, SWT.NONE);
public NoteTreeNode(Tree parent, Note data) { treeItem = new TreeItem(parent, SWT.NONE); init(data); }
if (displayedNote.getTab() != null) displayedNote.getTab().dispose();
for (TreeItem childTi : treeItem.getItems()) { ((NoteTreeNode) childTi.getData()).dispose(); }
public void dispose() { if (displayedNote.getTab() != null) displayedNote.getTab().dispose(); treeItem.dispose(); }
private void init(Note data) { this.displayedNote = new DisplayedNote(this, data);
private void init(DisplayedNote data) { displayedNote = data;
private void init(Note data) { this.displayedNote = new DisplayedNote(this, data); treeItem.setText(data.getName()); treeItem.setData(this); for (Note n : data.getChildren()) { new NoteTreeNode(treeItem, n); } }
for (Note n : data.getChildren()) { new NoteTreeNode(treeItem, n); }
private void init(Note data) { this.displayedNote = new DisplayedNote(this, data); treeItem.setText(data.getName()); treeItem.setData(this); for (Note n : data.getChildren()) { new NoteTreeNode(treeItem, n); } }
contactGroup.setVisible(true); validateTree(); repaint();
private void addContactListToWorkspace() { Workspace workspace = SparkManager.getWorkspace(); workspace.getWorkspacePane().addTab("Contacts", SparkRes.getImageIcon(SparkRes.SMALL_ALL_CHATS_IMAGE), this); //NOTRANS // Add To Contacts Menu final JMenu contactsMenu = SparkManager.getMainWindow().getMenuByName("Contacts"); JMenuItem addContactsMenu = new JMenuItem("", SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); ResourceUtils.resButton(addContactsMenu, "&Add Contact"); ResourceUtils.resButton(addContactGroupMenu, "Add Contact &Group"); contactsMenu.add(addContactsMenu); contactsMenu.add(addContactGroupMenu); addContactsMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); addContactGroupMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), "Name of Group:", "Add New Group", JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = addContactGroup(groupName); } } } }); // Add Toggle Contacts Menu ResourceUtils.resButton(showHideMenu, "&Show Empty Groups"); contactsMenu.add(showHideMenu); showHideMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showEmptyGroups(showHideMenu.isSelected()); } }); // Initialize vcard support SparkManager.getVCardManager(); }
contactGroup.setVisible(true); validateTree(); repaint();
public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), "Name of Group:", "Add New Group", JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = addContactGroup(groupName); } } }
public void showRosterDialog() { showRosterDialog(SparkManager.getMainWindow());
public void showRosterDialog(JFrame parent) { TitlePanel titlePanel = new TitlePanel(Res.getString("title.add.contact"), Res.getString("message.add.contact.to.list"), null, true); JPanel mainPanel = new JPanel() { public Dimension getPreferredSize() { final Dimension size = super.getPreferredSize(); size.width = 350; return size; } }; mainPanel.setLayout(new BorderLayout()); mainPanel.add(titlePanel, BorderLayout.NORTH); Object[] options = { Res.getString("add"), Res.getString("cancel") }; pane = new JOptionPane(panel, -1, 2, null, options, options[0]); mainPanel.add(pane, BorderLayout.CENTER); dialog = new JDialog(parent, Res.getString("title.add.contact"), false); dialog.setContentPane(mainPanel); dialog.pack(); dialog.setLocationRelativeTo(parent); pane.addPropertyChangeListener(this); dialog.setVisible(true); dialog.toFront(); dialog.requestFocus(); jidField.requestFocus();
public void showRosterDialog() { showRosterDialog(SparkManager.getMainWindow()); }
if (status != null && status.indexOf("phone") != -1) {
if (status != null && status.toLowerCase().indexOf("phone") != -1) {
public void updatePresenceIcon(Presence presence) { ChatManager chatManager = SparkManager.getChatManager(); boolean handled = chatManager.fireContactItemPresenceChanged(this, presence); if (handled) { return; } String status = presence != null ? presence.getStatus() : null; Icon statusIcon = SparkRes.getImageIcon(SparkRes.GREEN_BALL); boolean isAvailable = false; if (status == null && presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { status = "Available"; isAvailable = true; } else if (mode == Presence.Mode.away) { status = "I'm away"; statusIcon = SparkRes.getImageIcon(SparkRes.IM_AWAY); } else if (mode == Presence.Mode.chat) { status = "I'm free to chat"; } else if (mode == Presence.Mode.dnd) { status = "Do not disturb"; statusIcon = SparkRes.getImageIcon(SparkRes.IM_AWAY); } else if (mode == Presence.Mode.xa) { status = "Extended away"; statusIcon = SparkRes.getImageIcon(SparkRes.IM_AWAY); } } else if (presence != null && (presence.getMode() == Presence.Mode.dnd || presence.getMode() == Presence.Mode.away || presence.getMode() == Presence.Mode.xa)) { statusIcon = SparkRes.getImageIcon(SparkRes.IM_AWAY); } else if (presence != null && presence.getType() == Presence.Type.available) { isAvailable = true; } else if (presence == null) { getNicknameLabel().setFont(new Font("Dialog", Font.PLAIN, 11)); getNicknameLabel().setForeground((Color)UIManager.get("ContactItemOffline.color")); RosterEntry entry = SparkManager.getConnection().getRoster().getEntry(getFullJID()); if (entry != null && (entry.getType() == RosterPacket.ItemType.NONE || entry.getType() == RosterPacket.ItemType.FROM) && RosterPacket.ItemStatus.SUBSCRIPTION_PENDING == entry.getStatus()) { // Do not move out of group. setIcon(SparkRes.getImageIcon(SparkRes.SMALL_QUESTION)); getNicknameLabel().setFont(new Font("Dialog", Font.PLAIN, 11)); setStatusText("Pending"); } else { setIcon(null); setFont(new Font("Dialog", Font.PLAIN, 11)); getNicknameLabel().setFont(new Font("Dialog", Font.PLAIN, 11)); setAvailable(false); setStatusText(""); } sideIcon.setIcon(null); setAvailable(false); return; } StatusItem statusItem = SparkManager.getWorkspace().getStatusBar().getItemFromPresence(presence); if (statusItem != null) { setIcon(statusItem.getIcon()); } else { setIcon(statusIcon); } if (status != null) { setStatus(status); } if (status != null && status.indexOf("phone") != -1) { statusIcon = SparkRes.getImageIcon(SparkRes.ON_PHONE_IMAGE); setIcon(statusIcon); } // Always change nickname label to black. getNicknameLabel().setForeground((Color)UIManager.get("ContactItemNickname.foreground")); if (isAvailable) { getNicknameLabel().setFont(new Font("Dialog", Font.PLAIN, 11)); if ("Online".equals(status) || "Available".equalsIgnoreCase(status)) { setStatusText(""); } else { setStatusText(status); } } else if (presence != null) { getNicknameLabel().setFont(new Font("Dialog", Font.ITALIC, 11)); getNicknameLabel().setForeground(Color.gray); if (status != null) { setStatusText(status); } } setAvailable(true); }
if(numDays > 0){ buf.append(numDays + " d, "); }
public static String getTimeFromLong(long diff) { final String HOURS = "h"; final String MINUTES = "min"; final String SECONDS = "sec"; final long MS_IN_A_DAY = 1000 * 60 * 60 * 24; final long MS_IN_AN_HOUR = 1000 * 60 * 60; final long MS_IN_A_MINUTE = 1000 * 60; final long MS_IN_A_SECOND = 1000; Date currentTime = new Date(); long numDays = diff / MS_IN_A_DAY; diff = diff % MS_IN_A_DAY; long numHours = diff / MS_IN_AN_HOUR; diff = diff % MS_IN_AN_HOUR; long numMinutes = diff / MS_IN_A_MINUTE; diff = diff % MS_IN_A_MINUTE; long numSeconds = diff / MS_IN_A_SECOND; diff = diff % MS_IN_A_SECOND; long numMilliseconds = diff; StringBuffer buf = new StringBuffer(); if (numHours > 0) { buf.append(numHours + " " + HOURS + ", "); } if (numMinutes > 0) { buf.append(numMinutes + " " + MINUTES); } //buf.append(numSeconds + " " + SECONDS); String result = buf.toString(); if (numMinutes < 1) { result = "< 1 minute"; } return result; }
if (running) {
if (!running) {
public Object invoke(ObjectName objectName, String methodName) throws org.apache.geronimo.kernel.GBeanNotFoundException, org.apache.geronimo.kernel.NoSuchOperationException, Exception { boolean running = isRunning(objectName); if (running) { throw new IllegalStateException("Service is not running: name=" + objectName); } ServiceInvoker serviceInvoker = getServiceInvoker(objectName); try { Object value = serviceInvoker.invoke(methodName, NO_ARGS, NO_TYPES); return value; } catch (NoSuchOperationException e) { throw new org.apache.geronimo.kernel.NoSuchOperationException(e); } }
if (!Character.isWhitespace(s.charAt(i))) return s.substring(0, i);
if (!Character.isWhitespace(s.charAt(i))) return s.substring(0, i+1);
public static String rtrim(String s) { if (s == null) return null; for (int i = s.length() - 1; i > -1; i--) { if (!Character.isWhitespace(s.charAt(i))) return s.substring(0, i); } // if all WS return empty string return ""; }
g.getChildren().add(WFUtil.getTextVB(ref + "versionId"));
g.getChildren().add(WFUtil.getTextVB(ref + "versionName"));
private UIComponent getDetailPanel() { WFResourceUtil localizer = WFResourceUtil.getResourceUtilArticle(); HtmlPanelGrid dp = WFPanelUtil.getPlainFormPanel(1); WFComponentSelector cs = new WFComponentSelector(); cs.setId(COMPONENT_SELECTOR_ID); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(1); p.setId(NO_ARTICLE_ID); p.getChildren().add(localizer.getHeaderTextVB("no_article_selected")); cs.add(p); p = WFPanelUtil.getPlainFormPanel(1); p.setId(ARTICLE_LIST_ID); p.getChildren().add(WFUtil.getHeaderTextVB(ref + "headline")); p.getChildren().add(WFUtil.getText(" ")); p.getChildren().add(WFUtil.getTextVB(ref + "teaser")); p.getChildren().add(WFUtil.getText(" ")); WFPlainOutputText bodyText = new WFPlainOutputText(); WFUtil.setValueBinding(bodyText, "value", ref + "body"); p.getChildren().add(bodyText); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(new WFPlainOutputText("<hr/>")); UIComponent g = WFUtil.group(localizer.getHeaderTextVB("author"), WFUtil.getHeaderText(": ")); g.getChildren().add(WFUtil.getTextVB(ref + "author")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); g = WFUtil.group(localizer.getHeaderTextVB("created"), WFUtil.getHeaderText(": ")); g.getChildren().add(WFUtil.getTextVB(ref + "creationDate")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); g = WFUtil.group(localizer.getHeaderTextVB("status"), WFUtil.getHeaderText(": ")); g.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); HtmlOutputText t = WFUtil.getTextVB(ref + "categoryNames"); t.setConverter(new WFCommaSeparatedListConverter()); g = WFUtil.group(localizer.getHeaderTextVB("categories"), WFUtil.getHeaderText(": ")); g.getChildren().add(t); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); g = WFUtil.group(localizer.getHeaderTextVB("current_version"), WFUtil.getHeaderText(": ")); g.getChildren().add(WFUtil.getTextVB(ref + "versionId")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); g = WFUtil.group(localizer.getHeaderTextVB("comment"), WFUtil.getHeaderText(": ")); g.getChildren().add(WFUtil.getTextVB(ref + "comment")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); g = WFUtil.group(localizer.getHeaderTextVB("source"), WFUtil.getHeaderText(": ")); g.getChildren().add(WFUtil.getTextVB(ref + "source")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); WebDAVFileDetails details = new WebDAVFileDetails(); WFUtil.setValueBinding(details,"currentResourcePath",ref+"resourcePath"); p.getChildren().add(details); cs.add(p); cs.setSelectedId(NO_ARTICLE_ID, true); dp.getChildren().add(cs); return dp; }
public FileTemplate(Broker broker, File templateFile) { super(broker); myFile = templateFile;
public FileTemplate(Broker broker, String filename) { this (broker, new File(filename), defaultEncoding(broker));
public FileTemplate(Broker broker, File templateFile) { super(broker); myFile = templateFile; }
getLog().debug( "excludedClasses" + excludedClasses );
getLog().debug( "excludedClasses[" + excludedClasses + "]");
public void execute() throws MojoExecutionException, MojoFailureException { getLog().debug( " ======= XBeanMojo settings =======" ); getLog().debug( "namespace[" + namespace + "]" ); getLog().debug( "srcDir[" + srcDir + "]" ); getLog().debug( "schema[" + schema + "]" ); getLog().debug( "excludedClasses" + excludedClasses ); getLog().debug( "outputDir[" + outputDir + "]" ); getLog().debug( "propertyEditorPaths[" + propertyEditorPaths + "]" ); getLog().debug( "schemaAsArtifact[" + schemaAsArtifact + "]"); if (schema == null) { schema = new File(outputDir, project.getArtifactId() + ".xsd"); } if (propertyEditorPaths != null) { List editorSearchPath = new LinkedList(Arrays.asList(PropertyEditorManager.getEditorSearchPath())); StringTokenizer paths = new StringTokenizer(propertyEditorPaths, " ,"); editorSearchPath.addAll(Collections.list(paths)); PropertyEditorManager.setEditorSearchPath((String[]) editorSearchPath.toArray(new String[editorSearchPath.size()])); } ClassLoader oldCL = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); try { schema.getParentFile().mkdirs(); String[] excludedClasses = null; if (this.excludedClasses != null) { excludedClasses = this.excludedClasses.split(" *, *"); } MappingLoader mappingLoader = new QdoxMappingLoader(namespace, new File[] { srcDir }, excludedClasses); GeneratorPlugin[] plugins = new GeneratorPlugin[]{ new XmlMetadataGenerator(outputDir.getAbsolutePath(), schema), new DocumentationGenerator(schema), new XsdGenerator(schema), new WikiDocumentationGenerator(schema), }; // load the mappings Set namespaces = mappingLoader.loadNamespaces(); if (namespaces.isEmpty()) { System.out.println("Warning: no namespaces found!"); } // generate the files for (Iterator iterator = namespaces.iterator(); iterator.hasNext();) { NamespaceMapping namespaceMapping = (NamespaceMapping) iterator.next(); for (int i = 0; i < plugins.length; i++) { GeneratorPlugin plugin = plugins[i]; plugin.setLog(this); plugin.generate(namespaceMapping); } for (Iterator iter = generatorPlugins.iterator(); iter.hasNext();) { GeneratorPlugin plugin = (GeneratorPlugin) iter.next(); plugin.setLog(this); plugin.generate(namespaceMapping); } } // Attach them as artifacts if (schemaAsArtifact) { projectHelper.attachArtifact(project, "xsd", null, schema); projectHelper.attachArtifact(project, "html", "schema", new File(schema.getAbsolutePath() + ".html")); } Resource res = new Resource(); res.setDirectory(outputDir.toString()); project.addResource(res); log("...done."); } catch (Exception e) { throw new BuildException(e); } finally { Thread.currentThread().setContextClassLoader(oldCL); } }
enum = e;
enumeration = e;
public EnumIterator (Enumeration e) { enum = e; hasNext = e.hasMoreElements(); }
break; case 0: case 4: if ((0xffffff6fffffdbffL & l) == 0L) break; if (kind > 56) kind = 56; jjCheckNAdd(4);
private final int jjMoveNfa_0(int startState, int curPos){ int[] nextStates; int startsAt = 0; jjnewStateCnt = 5; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xfc00ffffffffffffL & l) != 0L) { if (kind > 21) kind = 21; } if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; case 0: case 4: if ((0xffffff6fffffdbffL & l) == 0L) break; if (kind > 56) kind = 56; jjCheckNAdd(4); break; case 2: if (curChar == 10 && kind > 21) kind = 21; break; case 3: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xf8000001f8000001L & l) != 0L && kind > 21) kind = 21; break; case 0: if ((0xffffffffefffffffL & l) != 0L) { if (kind > 56) kind = 56; jjCheckNAdd(4); } else if (curChar == 92) jjAddStates(2, 3); break; case 4: if ((0xffffffffefffffffL & l) == 0L) break; if (kind > 56) kind = 56; jjCheckNAdd(4); break; default : break; } } while(i != startsAt); } else { int hiByte = (int)(curChar >> 8); int i1 = hiByte >> 6; long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 21) kind = 21; break; case 0: case 4: if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) break; if (kind > 56) kind = 56; jjCheckNAdd(4); break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 5 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } }}
case 1: if ((0xf8000001f8000001L & l) != 0L && kind > 21) kind = 21; break;
private final int jjMoveNfa_0(int startState, int curPos){ int[] nextStates; int startsAt = 0; jjnewStateCnt = 5; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xfc00ffffffffffffL & l) != 0L) { if (kind > 21) kind = 21; } if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; case 0: case 4: if ((0xffffff6fffffdbffL & l) == 0L) break; if (kind > 56) kind = 56; jjCheckNAdd(4); break; case 2: if (curChar == 10 && kind > 21) kind = 21; break; case 3: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xf8000001f8000001L & l) != 0L && kind > 21) kind = 21; break; case 0: if ((0xffffffffefffffffL & l) != 0L) { if (kind > 56) kind = 56; jjCheckNAdd(4); } else if (curChar == 92) jjAddStates(2, 3); break; case 4: if ((0xffffffffefffffffL & l) == 0L) break; if (kind > 56) kind = 56; jjCheckNAdd(4); break; default : break; } } while(i != startsAt); } else { int hiByte = (int)(curChar >> 8); int i1 = hiByte >> 6; long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 21) kind = 21; break; case 0: case 4: if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) break; if (kind > 56) kind = 56; jjCheckNAdd(4); break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 5 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } }}
jjAddStates(2, 3);
jjAddStates(0, 1); break; case 1: if ((0xf8000001f8000001L & l) != 0L && kind > 21) kind = 21;
private final int jjMoveNfa_0(int startState, int curPos){ int[] nextStates; int startsAt = 0; jjnewStateCnt = 5; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xfc00ffffffffffffL & l) != 0L) { if (kind > 21) kind = 21; } if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; case 0: case 4: if ((0xffffff6fffffdbffL & l) == 0L) break; if (kind > 56) kind = 56; jjCheckNAdd(4); break; case 2: if (curChar == 10 && kind > 21) kind = 21; break; case 3: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xf8000001f8000001L & l) != 0L && kind > 21) kind = 21; break; case 0: if ((0xffffffffefffffffL & l) != 0L) { if (kind > 56) kind = 56; jjCheckNAdd(4); } else if (curChar == 92) jjAddStates(2, 3); break; case 4: if ((0xffffffffefffffffL & l) == 0L) break; if (kind > 56) kind = 56; jjCheckNAdd(4); break; default : break; } } while(i != startsAt); } else { int hiByte = (int)(curChar >> 8); int i1 = hiByte >> 6; long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 21) kind = 21; break; case 0: case 4: if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) break; if (kind > 56) kind = 56; jjCheckNAdd(4); break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 5 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } }}
case 1: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 21) kind = 21; break;
private final int jjMoveNfa_0(int startState, int curPos){ int[] nextStates; int startsAt = 0; jjnewStateCnt = 5; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xfc00ffffffffffffL & l) != 0L) { if (kind > 21) kind = 21; } if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; case 0: case 4: if ((0xffffff6fffffdbffL & l) == 0L) break; if (kind > 56) kind = 56; jjCheckNAdd(4); break; case 2: if (curChar == 10 && kind > 21) kind = 21; break; case 3: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xf8000001f8000001L & l) != 0L && kind > 21) kind = 21; break; case 0: if ((0xffffffffefffffffL & l) != 0L) { if (kind > 56) kind = 56; jjCheckNAdd(4); } else if (curChar == 92) jjAddStates(2, 3); break; case 4: if ((0xffffffffefffffffL & l) == 0L) break; if (kind > 56) kind = 56; jjCheckNAdd(4); break; default : break; } } while(i != startsAt); } else { int hiByte = (int)(curChar >> 8); int i1 = hiByte >> 6; long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 21) kind = 21; break; case 0: case 4: if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) break; if (kind > 56) kind = 56; jjCheckNAdd(4); break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 5 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } }}
break; case 1: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 21) kind = 21;
private final int jjMoveNfa_0(int startState, int curPos){ int[] nextStates; int startsAt = 0; jjnewStateCnt = 5; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xfc00ffffffffffffL & l) != 0L) { if (kind > 21) kind = 21; } if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; case 0: case 4: if ((0xffffff6fffffdbffL & l) == 0L) break; if (kind > 56) kind = 56; jjCheckNAdd(4); break; case 2: if (curChar == 10 && kind > 21) kind = 21; break; case 3: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xf8000001f8000001L & l) != 0L && kind > 21) kind = 21; break; case 0: if ((0xffffffffefffffffL & l) != 0L) { if (kind > 56) kind = 56; jjCheckNAdd(4); } else if (curChar == 92) jjAddStates(2, 3); break; case 4: if ((0xffffffffefffffffL & l) == 0L) break; if (kind > 56) kind = 56; jjCheckNAdd(4); break; default : break; } } while(i != startsAt); } else { int hiByte = (int)(curChar >> 8); int i1 = hiByte >> 6; long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 21) kind = 21; break; case 0: case 4: if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) break; if (kind > 56) kind = 56; jjCheckNAdd(4); break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 5 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } }}
break; case 0: case 4: if ((0xffffffebffffdbffL & l) == 0L) break; if (kind > 55) kind = 55; jjCheckNAdd(4);
private final int jjMoveNfa_1(int startState, int curPos){ int[] nextStates; int startsAt = 0; jjnewStateCnt = 5; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xfc00ffffffffffffL & l) != 0L) { if (kind > 21) kind = 21; } if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; case 0: case 4: if ((0xffffffebffffdbffL & l) == 0L) break; if (kind > 55) kind = 55; jjCheckNAdd(4); break; case 2: if (curChar == 10 && kind > 21) kind = 21; break; case 3: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xf8000001f8000001L & l) != 0L && kind > 21) kind = 21; break; case 0: if ((0xffffffffefffffffL & l) != 0L) { if (kind > 55) kind = 55; jjCheckNAdd(4); } else if (curChar == 92) jjAddStates(2, 3); break; case 4: if ((0xffffffffefffffffL & l) == 0L) break; if (kind > 55) kind = 55; jjCheckNAdd(4); break; default : break; } } while(i != startsAt); } else { int hiByte = (int)(curChar >> 8); int i1 = hiByte >> 6; long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 21) kind = 21; break; case 0: case 4: if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) break; if (kind > 55) kind = 55; jjCheckNAdd(4); break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 5 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } }}
case 1: if ((0xf8000001f8000001L & l) != 0L && kind > 21) kind = 21; break;
private final int jjMoveNfa_1(int startState, int curPos){ int[] nextStates; int startsAt = 0; jjnewStateCnt = 5; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xfc00ffffffffffffL & l) != 0L) { if (kind > 21) kind = 21; } if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; case 0: case 4: if ((0xffffffebffffdbffL & l) == 0L) break; if (kind > 55) kind = 55; jjCheckNAdd(4); break; case 2: if (curChar == 10 && kind > 21) kind = 21; break; case 3: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xf8000001f8000001L & l) != 0L && kind > 21) kind = 21; break; case 0: if ((0xffffffffefffffffL & l) != 0L) { if (kind > 55) kind = 55; jjCheckNAdd(4); } else if (curChar == 92) jjAddStates(2, 3); break; case 4: if ((0xffffffffefffffffL & l) == 0L) break; if (kind > 55) kind = 55; jjCheckNAdd(4); break; default : break; } } while(i != startsAt); } else { int hiByte = (int)(curChar >> 8); int i1 = hiByte >> 6; long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 21) kind = 21; break; case 0: case 4: if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) break; if (kind > 55) kind = 55; jjCheckNAdd(4); break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 5 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } }}
jjAddStates(2, 3);
jjAddStates(0, 1); break; case 1: if ((0xf8000001f8000001L & l) != 0L && kind > 21) kind = 21;
private final int jjMoveNfa_1(int startState, int curPos){ int[] nextStates; int startsAt = 0; jjnewStateCnt = 5; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xfc00ffffffffffffL & l) != 0L) { if (kind > 21) kind = 21; } if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; case 0: case 4: if ((0xffffffebffffdbffL & l) == 0L) break; if (kind > 55) kind = 55; jjCheckNAdd(4); break; case 2: if (curChar == 10 && kind > 21) kind = 21; break; case 3: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xf8000001f8000001L & l) != 0L && kind > 21) kind = 21; break; case 0: if ((0xffffffffefffffffL & l) != 0L) { if (kind > 55) kind = 55; jjCheckNAdd(4); } else if (curChar == 92) jjAddStates(2, 3); break; case 4: if ((0xffffffffefffffffL & l) == 0L) break; if (kind > 55) kind = 55; jjCheckNAdd(4); break; default : break; } } while(i != startsAt); } else { int hiByte = (int)(curChar >> 8); int i1 = hiByte >> 6; long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 21) kind = 21; break; case 0: case 4: if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) break; if (kind > 55) kind = 55; jjCheckNAdd(4); break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 5 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } }}
case 1: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 21) kind = 21; break;
private final int jjMoveNfa_1(int startState, int curPos){ int[] nextStates; int startsAt = 0; jjnewStateCnt = 5; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xfc00ffffffffffffL & l) != 0L) { if (kind > 21) kind = 21; } if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; case 0: case 4: if ((0xffffffebffffdbffL & l) == 0L) break; if (kind > 55) kind = 55; jjCheckNAdd(4); break; case 2: if (curChar == 10 && kind > 21) kind = 21; break; case 3: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xf8000001f8000001L & l) != 0L && kind > 21) kind = 21; break; case 0: if ((0xffffffffefffffffL & l) != 0L) { if (kind > 55) kind = 55; jjCheckNAdd(4); } else if (curChar == 92) jjAddStates(2, 3); break; case 4: if ((0xffffffffefffffffL & l) == 0L) break; if (kind > 55) kind = 55; jjCheckNAdd(4); break; default : break; } } while(i != startsAt); } else { int hiByte = (int)(curChar >> 8); int i1 = hiByte >> 6; long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 21) kind = 21; break; case 0: case 4: if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) break; if (kind > 55) kind = 55; jjCheckNAdd(4); break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 5 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } }}
break; case 1: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 21) kind = 21;
private final int jjMoveNfa_1(int startState, int curPos){ int[] nextStates; int startsAt = 0; jjnewStateCnt = 5; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xfc00ffffffffffffL & l) != 0L) { if (kind > 21) kind = 21; } if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; case 0: case 4: if ((0xffffffebffffdbffL & l) == 0L) break; if (kind > 55) kind = 55; jjCheckNAdd(4); break; case 2: if (curChar == 10 && kind > 21) kind = 21; break; case 3: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 2; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xf8000001f8000001L & l) != 0L && kind > 21) kind = 21; break; case 0: if ((0xffffffffefffffffL & l) != 0L) { if (kind > 55) kind = 55; jjCheckNAdd(4); } else if (curChar == 92) jjAddStates(2, 3); break; case 4: if ((0xffffffffefffffffL & l) == 0L) break; if (kind > 55) kind = 55; jjCheckNAdd(4); break; default : break; } } while(i != startsAt); } else { int hiByte = (int)(curChar >> 8); int i1 = hiByte >> 6; long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 21) kind = 21; break; case 0: case 4: if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) break; if (kind > 55) kind = 55; jjCheckNAdd(4); break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 5 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } }}
jjAddStates(4, 5);
jjAddStates(2, 3);
private final int jjMoveNfa_3(int startState, int curPos){ int[] nextStates; int startsAt = 0; jjnewStateCnt = 31; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 4: if ((0xfc00ffffffffffffL & l) != 0L) { if (kind > 21) kind = 21; } if (curChar == 13) jjstateSet[jjnewStateCnt++] = 5; break; case 2: if ((0x3ff000000000000L & l) != 0L) { if (kind > 53) kind = 53; jjCheckNAdd(30); } else if ((0x2400L & l) != 0L) { if (kind > 30) kind = 30; } else if ((0x100000200L & l) != 0L) { if (kind > 29) kind = 29; jjCheckNAdd(7); } else if (curChar == 33) { if (kind > 49) kind = 49; } else if (curChar == 38) jjstateSet[jjnewStateCnt++] = 15; else if (curChar == 60) jjstateSet[jjnewStateCnt++] = 13; else if (curChar == 35) jjstateSet[jjnewStateCnt++] = 0; if (curChar == 33) jjstateSet[jjnewStateCnt++] = 11; else if (curChar == 13) jjstateSet[jjnewStateCnt++] = 8; break; case 0: if (curChar != 35) break; if (kind > 16) kind = 16; jjCheckNAdd(1); break; case 1: if ((0xffffffffffffdbffL & l) == 0L) break; if (kind > 16) kind = 16; jjCheckNAdd(1); break; case 5: if (curChar == 10 && kind > 21) kind = 21; break; case 6: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 5; break; case 7: if ((0x100000200L & l) == 0L) break; if (kind > 29) kind = 29; jjCheckNAdd(7); break; case 8: if (curChar == 10 && kind > 30) kind = 30; break; case 9: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 8; break; case 10: if ((0x2400L & l) != 0L && kind > 30) kind = 30; break; case 11: if (curChar == 61 && kind > 42) kind = 42; break; case 12: if (curChar == 33) jjstateSet[jjnewStateCnt++] = 11; break; case 13: if (curChar == 62 && kind > 42) kind = 42; break; case 14: if (curChar == 60) jjstateSet[jjnewStateCnt++] = 13; break; case 15: if (curChar == 38 && kind > 47) kind = 47; break; case 16: if (curChar == 38) jjstateSet[jjnewStateCnt++] = 15; break; case 24: if (curChar == 33 && kind > 49) kind = 49; break; case 29: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 52) kind = 52; jjstateSet[jjnewStateCnt++] = 29; break; case 30: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 53) kind = 53; jjCheckNAdd(30); break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 4: if ((0xf8000001f8000001L & l) != 0L && kind > 21) kind = 21; break; case 2: if ((0x7fffffe07fffffeL & l) != 0L) { if (kind > 52) kind = 52; jjCheckNAdd(29); } else if (curChar == 124) jjstateSet[jjnewStateCnt++] = 20; else if (curChar == 92) jjAddStates(4, 5); if (curChar == 78) jjstateSet[jjnewStateCnt++] = 26; else if (curChar == 79) jjstateSet[jjnewStateCnt++] = 22; else if (curChar == 65) jjstateSet[jjnewStateCnt++] = 18; break; case 1: if (kind > 16) kind = 16; jjstateSet[jjnewStateCnt++] = 1; break; case 3: if (curChar == 92) jjAddStates(4, 5); break; case 17: if (curChar == 68 && kind > 47) kind = 47; break; case 18: if (curChar == 78) jjstateSet[jjnewStateCnt++] = 17; break; case 19: if (curChar == 65) jjstateSet[jjnewStateCnt++] = 18; break; case 20: if (curChar == 124 && kind > 48) kind = 48; break; case 21: if (curChar == 124) jjstateSet[jjnewStateCnt++] = 20; break; case 22: if (curChar == 82 && kind > 48) kind = 48; break; case 23: if (curChar == 79) jjstateSet[jjnewStateCnt++] = 22; break; case 25: if (curChar == 84 && kind > 49) kind = 49; break; case 26: if (curChar == 79) jjstateSet[jjnewStateCnt++] = 25; break; case 27: if (curChar == 78) jjstateSet[jjnewStateCnt++] = 26; break; case 28: if ((0x7fffffe07fffffeL & l) == 0L) break; if (kind > 52) kind = 52; jjCheckNAdd(29); break; case 29: if ((0x7fffffe87fffffeL & l) == 0L) break; if (kind > 52) kind = 52; jjCheckNAdd(29); break; default : break; } } while(i != startsAt); } else { int hiByte = (int)(curChar >> 8); int i1 = hiByte >> 6; long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 4: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 21) kind = 21; break; case 1: if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) break; if (kind > 16) kind = 16; jjstateSet[jjnewStateCnt++] = 1; break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 31 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } }}
case 1: case 0: if ((0xffffffe7ffffffffL & l) == 0L) break; if (kind > 11) kind = 11; jjCheckNAdd(0); break;
private final int jjMoveNfa_4(int startState, int curPos){ int[] nextStates; int startsAt = 0; jjnewStateCnt = 5; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 1: case 0: if ((0xffffffe7ffffffffL & l) == 0L) break; if (kind > 11) kind = 11; jjCheckNAdd(0); break; case 2: if ((0xfc00ffffffffffffL & l) != 0L) { if (kind > 21) kind = 21; } if (curChar == 13) jjstateSet[jjnewStateCnt++] = 3; break; case 3: if (curChar == 10 && kind > 21) kind = 21; break; case 4: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 3; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xd7ffffffefffffffL & l) != 0L) { if (kind > 11) kind = 11; jjCheckNAdd(0); } else if (curChar == 92) jjAddStates(0, 1); break; case 2: if ((0xf8000001f8000001L & l) != 0L && kind > 21) kind = 21; break; case 0: if ((0xd7ffffffefffffffL & l) == 0L) break; if (kind > 11) kind = 11; jjCheckNAdd(0); break; default : break; } } while(i != startsAt); } else { int hiByte = (int)(curChar >> 8); int i1 = hiByte >> 6; long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: case 0: if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) break; if (kind > 11) kind = 11; jjCheckNAdd(0); break; case 2: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 21) kind = 21; break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 5 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } }}
jjAddStates(0, 1); break; case 2: if ((0xf8000001f8000001L & l) != 0L && kind > 21) kind = 21;
jjAddStates(4, 5);
private final int jjMoveNfa_4(int startState, int curPos){ int[] nextStates; int startsAt = 0; jjnewStateCnt = 5; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 1: case 0: if ((0xffffffe7ffffffffL & l) == 0L) break; if (kind > 11) kind = 11; jjCheckNAdd(0); break; case 2: if ((0xfc00ffffffffffffL & l) != 0L) { if (kind > 21) kind = 21; } if (curChar == 13) jjstateSet[jjnewStateCnt++] = 3; break; case 3: if (curChar == 10 && kind > 21) kind = 21; break; case 4: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 3; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xd7ffffffefffffffL & l) != 0L) { if (kind > 11) kind = 11; jjCheckNAdd(0); } else if (curChar == 92) jjAddStates(0, 1); break; case 2: if ((0xf8000001f8000001L & l) != 0L && kind > 21) kind = 21; break; case 0: if ((0xd7ffffffefffffffL & l) == 0L) break; if (kind > 11) kind = 11; jjCheckNAdd(0); break; default : break; } } while(i != startsAt); } else { int hiByte = (int)(curChar >> 8); int i1 = hiByte >> 6; long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: case 0: if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) break; if (kind > 11) kind = 11; jjCheckNAdd(0); break; case 2: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 21) kind = 21; break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 5 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } }}
break; case 2: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 21) kind = 21;
private final int jjMoveNfa_4(int startState, int curPos){ int[] nextStates; int startsAt = 0; jjnewStateCnt = 5; int i = 1; jjstateSet[0] = startState; int j, kind = 0x7fffffff; for (;;) { if (++jjround == 0x7fffffff) ReInitRounds(); if (curChar < 64) { long l = 1L << curChar; MatchLoop: do { switch(jjstateSet[--i]) { case 1: case 0: if ((0xffffffe7ffffffffL & l) == 0L) break; if (kind > 11) kind = 11; jjCheckNAdd(0); break; case 2: if ((0xfc00ffffffffffffL & l) != 0L) { if (kind > 21) kind = 21; } if (curChar == 13) jjstateSet[jjnewStateCnt++] = 3; break; case 3: if (curChar == 10 && kind > 21) kind = 21; break; case 4: if (curChar == 13) jjstateSet[jjnewStateCnt++] = 3; break; default : break; } } while(i != startsAt); } else if (curChar < 128) { long l = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: if ((0xd7ffffffefffffffL & l) != 0L) { if (kind > 11) kind = 11; jjCheckNAdd(0); } else if (curChar == 92) jjAddStates(0, 1); break; case 2: if ((0xf8000001f8000001L & l) != 0L && kind > 21) kind = 21; break; case 0: if ((0xd7ffffffefffffffL & l) == 0L) break; if (kind > 11) kind = 11; jjCheckNAdd(0); break; default : break; } } while(i != startsAt); } else { int hiByte = (int)(curChar >> 8); int i1 = hiByte >> 6; long l1 = 1L << (hiByte & 077); int i2 = (curChar & 0xff) >> 6; long l2 = 1L << (curChar & 077); MatchLoop: do { switch(jjstateSet[--i]) { case 1: case 0: if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) break; if (kind > 11) kind = 11; jjCheckNAdd(0); break; case 2: if (jjCanMove_0(hiByte, i1, i2, l1, l2) && kind > 21) kind = 21; break; default : break; } } while(i != startsAt); } if (kind != 0x7fffffff) { jjmatchedKind = kind; jjmatchedPos = curPos; kind = 0x7fffffff; } ++curPos; if ((i = jjnewStateCnt) == (startsAt = 5 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } }}
if ((active0 & 0x400000L) != 0L) return 4;
private final int jjStopStringLiteralDfa_3(int pos, long active0){ switch (pos) { case 0: if ((active0 & 0x400000L) != 0L) return 4; if ((active0 & 0x804000L) != 0L) return 0; if ((active0 & 0x1c000000L) != 0L) { jjmatchedKind = 52; return 29; } if ((active0 & 0x3000000000L) != 0L) return 13; return -1; case 1: if ((active0 & 0x1c000000L) != 0L) { jjmatchedKind = 52; jjmatchedPos = 1; return 29; } return -1; case 2: if ((active0 & 0x1c000000L) != 0L) { jjmatchedKind = 52; jjmatchedPos = 2; return 29; } return -1; case 3: if ((active0 & 0x10000000L) != 0L) { jjmatchedKind = 52; jjmatchedPos = 3; return 29; } if ((active0 & 0xc000000L) != 0L) return 29; return -1; case 4: if ((active0 & 0x10000000L) != 0L) return 29; return -1; default : return -1; }}
if ((active0 & 0xc000000L) != 0L) return 29;
private final int jjStopStringLiteralDfa_3(int pos, long active0){ switch (pos) { case 0: if ((active0 & 0x400000L) != 0L) return 4; if ((active0 & 0x804000L) != 0L) return 0; if ((active0 & 0x1c000000L) != 0L) { jjmatchedKind = 52; return 29; } if ((active0 & 0x3000000000L) != 0L) return 13; return -1; case 1: if ((active0 & 0x1c000000L) != 0L) { jjmatchedKind = 52; jjmatchedPos = 1; return 29; } return -1; case 2: if ((active0 & 0x1c000000L) != 0L) { jjmatchedKind = 52; jjmatchedPos = 2; return 29; } return -1; case 3: if ((active0 & 0x10000000L) != 0L) { jjmatchedKind = 52; jjmatchedPos = 3; return 29; } if ((active0 & 0xc000000L) != 0L) return 29; return -1; case 4: if ((active0 & 0x10000000L) != 0L) return 29; return -1; default : return -1; }}
THEMES_DIRECTORY = new File("c:\\xtra\\themes");
private ThemeManager() { emoticonManager = EmoticonManager.getInstance(); BrowserEngineManager bem = BrowserEngineManager.instance(); //specific engine if you want and the engine you specified will return bem.setActiveEngine(BrowserEngineManager.MOZILLA); //IBrowserEngine be = bem.setActiveEngine(...); IBrowserEngine be = bem.getActiveEngine();//default or specified engine is returned // Note that the install directory is my name for temporary files and // not about mozilla. Me love Mozilla. be.setEnginePath("C:\\crapola\\mozilla\\mozilla.exe"); THEMES_DIRECTORY = new File(Spark.getBinDirectory().getParent(), "xtra/themes").getAbsoluteFile(); // For Testing THEMES_DIRECTORY = new File("c:\\xtra\\themes"); expandNewThemes(); final LocalPreferences pref = SettingsManager.getLocalPreferences(); String themeName = pref.getTheme(); File theme = new File(THEMES_DIRECTORY, themeName); try { setTheme(theme); } catch (Exception e) { e.printStackTrace(); } // Add Preference SparkManager.getPreferenceManager().addPreference(new ThemePreference()); }
Collections.sort(contactItems, itemComparator);
List<ContactItem> tempItems = getContactItems();
public synchronized void addContactItem(ContactItem item) { if (model.getSize() == 1 && model.getElementAt(0) == noContacts) { model.remove(0); } if ("Offline Group".equals(groupName)) { item.getNicknameLabel().setFont(new Font("Dialog", Font.PLAIN, 11)); item.getNicknameLabel().setForeground(Color.GRAY); } item.setGroupName(getGroupName()); contactItems.add(item); Collections.sort(contactItems, itemComparator); int index = contactItems.indexOf(item); Object[] objs = list.getSelectedValues(); model.insertElementAt(item, index); int[] intList = new int[objs.length]; for (int i = 0; i < objs.length; i++) { ContactItem contact = (ContactItem)objs[i]; intList[i] = model.indexOf(contact); } if (intList.length > 0) { list.setSelectedIndices(intList); } fireContactItemAdded(item); }
int index = contactItems.indexOf(item);
Collections.sort(tempItems, itemComparator); int index = tempItems.indexOf(item);
public synchronized void addContactItem(ContactItem item) { if (model.getSize() == 1 && model.getElementAt(0) == noContacts) { model.remove(0); } if ("Offline Group".equals(groupName)) { item.getNicknameLabel().setFont(new Font("Dialog", Font.PLAIN, 11)); item.getNicknameLabel().setForeground(Color.GRAY); } item.setGroupName(getGroupName()); contactItems.add(item); Collections.sort(contactItems, itemComparator); int index = contactItems.indexOf(item); Object[] objs = list.getSelectedValues(); model.insertElementAt(item, index); int[] intList = new int[objs.length]; for (int i = 0; i < objs.length; i++) { ContactItem contact = (ContactItem)objs[i]; intList[i] = model.indexOf(contact); } if (intList.length > 0) { list.setSelectedIndices(intList); } fireContactItemAdded(item); }
return dndList;
return statusList;
public Collection getStatusList() { return dndList; }
dndList.add(freeToChat); dndList.add(online); dndList.add(away); dndList.add(phone); dndList.add(extendedAway); dndList.add(dnd);
statusList.add(freeToChat); statusList.add(online); statusList.add(away); statusList.add(phone); statusList.add(extendedAway); statusList.add(dnd);
private void populateDndList() { final ImageIcon availableIcon = SparkRes.getImageIcon(SparkRes.GREEN_BALL); final ImageIcon awayIcon = SparkRes.getImageIcon(SparkRes.IM_AWAY); final ImageIcon dndIcon = SparkRes.getImageIcon(SparkRes.IM_DND); final ImageIcon phoneIcon = SparkRes.getImageIcon(SparkRes.ON_PHONE_IMAGE); StatusItem online = new StatusItem(new Presence(Presence.Type.available, "Online", -1, Presence.Mode.available), availableIcon); StatusItem freeToChat = new StatusItem(new Presence(Presence.Type.available, "Free To Chat", -1, Presence.Mode.chat), SparkRes.getImageIcon(SparkRes.FREE_TO_CHAT_IMAGE)); StatusItem away = new StatusItem(new Presence(Presence.Type.available, "Away", -1, Presence.Mode.away), awayIcon); StatusItem phone = new StatusItem(new Presence(Presence.Type.available, "On Phone", -1, Presence.Mode.away), phoneIcon); StatusItem dnd = new StatusItem(new Presence(Presence.Type.available, "Do Not Disturb", -1, Presence.Mode.dnd), dndIcon); StatusItem extendedAway = new StatusItem(new Presence(Presence.Type.available, "Extended Away", -1, Presence.Mode.xa), awayIcon); dndList.add(freeToChat); dndList.add(online); dndList.add(away); dndList.add(phone); dndList.add(extendedAway); dndList.add(dnd); // Set default presence icon (Avaialble) statusPanel.setIcon(availableIcon); }
Iterator statusIterator = dndList.iterator(); while (statusIterator.hasNext()) { final StatusItem statusItem = (StatusItem)statusIterator.next();
for(final StatusItem statusItem : statusList){
public void showPopup(MouseEvent e) { final JPopupMenu popup = new JPopupMenu(); List custom = CustomMessages.load(); if (custom == null) { custom = new ArrayList(); } // Build menu from dndList Iterator statusIterator = dndList.iterator(); while (statusIterator.hasNext()) { final StatusItem statusItem = (StatusItem)statusIterator.next(); final Action statusAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { final String text = statusItem.getText(); final StatusItem si = getStatusItem(text); if (si == null) { // Custom status return; } SwingWorker worker = new SwingWorker() { public Object construct() { SparkManager.getSessionManager().changePresence(si.getPresence()); return "ok"; } public void finished() { setStatus(text); } }; worker.start(); } }; statusAction.putValue(Action.NAME, statusItem.getText()); statusAction.putValue(Action.SMALL_ICON, statusItem.getIcon()); // Has Children boolean hasChildren = false; Iterator customItemIterator = custom.iterator(); while (customItemIterator.hasNext()) { final CustomStatusItem cItem = (CustomStatusItem)customItemIterator.next(); String type = cItem.getType(); if (type.equals(statusItem.getText())) { hasChildren = true; } } if (!hasChildren) { // Add as Menu Item popup.add(statusAction); } else { final JMenu mainStatusItem = new JMenu(statusAction); popup.add(mainStatusItem); // Add Custom Messages customItemIterator = custom.iterator(); while (customItemIterator.hasNext()) { final CustomStatusItem customItem = (CustomStatusItem)customItemIterator.next(); String type = customItem.getType(); if (type.equals(statusItem.getText())) { // Add Child Menu Action action = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { final String text = mainStatusItem.getText(); final StatusItem si = getStatusItem(text); if (si == null) { // Custom status return; } SwingWorker worker = new SwingWorker() { public Object construct() { Presence oldPresence = si.getPresence(); Presence presence = copyPresence(oldPresence); presence.setStatus(customItem.getStatus()); presence.setPriority(customItem.getPriority()); SparkManager.getSessionManager().changePresence(presence); return "ok"; } public void finished() { String status = customItem.getType() + " - " + customItem.getStatus(); setStatus(status); } }; worker.start(); } }; action.putValue(Action.NAME, customItem.getStatus()); action.putValue(Action.SMALL_ICON, statusItem.getIcon()); mainStatusItem.add(action); } } // If menu has children, allow it to still be clickable. mainStatusItem.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent mouseEvent) { statusAction.actionPerformed(null); popup.setVisible(false); } }); } } // Add change message final JMenuItem changeStatusMenu = new JMenuItem(Res.getString("menuitem.set.status.message"), SparkRes.getImageIcon(SparkRes.BLANK_IMAGE)); popup.addSeparator(); popup.add(changeStatusMenu); changeStatusMenu.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { CustomMessages.addCustomMessage(); } }); Action editMessagesAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { CustomMessages.editCustomMessages(); } }; editMessagesAction.putValue(Action.NAME, Res.getString("menuitem.edit.status.message")); popup.add(editMessagesAction); popup.show(statusPanel, 0, statusPanel.getHeight()); }
personalPanel.showJID(false);
public void showProfile(JComponent parent) { final JTabbedPane tabbedPane = new JTabbedPane(); personalPanel = new PersonalPanel(); tabbedPane.addTab("Personal", personalPanel); businessPanel = new BusinessPanel(); tabbedPane.addTab("Business", businessPanel); homePanel = new HomePanel(); tabbedPane.addTab("Home", homePanel); avatarPanel = new AvatarPanel(); tabbedPane.addTab("Avatar", avatarPanel); loadVCard(SparkManager.getSessionManager().getJID()); final JOptionPane pane; final JDialog dlg; TitlePanel titlePanel; ImageIcon icon = getAvatarIcon(); if (icon == null) { icon = SparkRes.getImageIcon(SparkRes.BLANK_24x24); } // Create the title panel for this dialog titlePanel = new TitlePanel("Edit Profile Information", "To save changes to your profile, click Save.", icon, true); // Construct main panel w/ layout. final JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); mainPanel.add(titlePanel, BorderLayout.NORTH); // The user should only be able to close this dialog. Object[] options = {"Save", "Cancel"}; pane = new JOptionPane(tabbedPane, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, options, options[0]); mainPanel.add(pane, BorderLayout.CENTER); JOptionPane p = new JOptionPane(); dlg = p.createDialog(parent, "Profile Information"); dlg.setModal(false); dlg.pack(); dlg.setSize(600, 400); dlg.setResizable(true); dlg.setContentPane(mainPanel); dlg.setLocationRelativeTo(parent); PropertyChangeListener changeListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { String value = (String)pane.getValue(); if ("Cancel".equals(value)) { pane.removePropertyChangeListener(this); dlg.dispose(); } else if ("Save".equals(value)) { pane.removePropertyChangeListener(this); dlg.dispose(); saveVCard(); } } }; pane.addPropertyChangeListener(changeListener); dlg.setVisible(true); dlg.toFront(); dlg.requestFocus(); personalPanel.focus(); }
Logger.logError(e.getMessage(), e);
Log.error(e.getMessage(), e);
public void messageReceived(final ChatRoom room, final Message message) { if (!SparkManager.getMainWindow().isFocused()) { SwingUtilities.invokeLater(new Runnable() { public void run() { try { String name = SparkManager.getUserManager().getUserNicknameFromJID(message.getFrom()); // Since it looks the method can return null do this in case if (name == null) { name = StringUtils.parseName(message.getFrom()); } VCard vCard = null; try { vCard = SparkManager.getVCardManager().getVCard( StringUtils.parseBareAddress(message.getFrom())); } catch (Exception e) { // vcard can time out so ignore } NSImage image = null; if (vCard != null) { byte[] bytes = vCard.getAvatar(); if (bytes != null) { try { NSData data = new NSData(bytes); image = new NSImage(data); } catch (Exception e) { // just incase there is an error i didn't intend } } } if (image == null) { image = getImage("/images/message-32x32.png"); } growl.notifyGrowlOf("Message Received", image, name, message.getBody(), null); } catch (Exception e) { Logger.logError(e.getMessage(), e); } } }); } }
Logger.logError(e.getMessage(), e);
Log.error(e.getMessage(), e);
public void run() { try { String name = SparkManager.getUserManager().getUserNicknameFromJID(message.getFrom()); // Since it looks the method can return null do this in case if (name == null) { name = StringUtils.parseName(message.getFrom()); } VCard vCard = null; try { vCard = SparkManager.getVCardManager().getVCard( StringUtils.parseBareAddress(message.getFrom())); } catch (Exception e) { // vcard can time out so ignore } NSImage image = null; if (vCard != null) { byte[] bytes = vCard.getAvatar(); if (bytes != null) { try { NSData data = new NSData(bytes); image = new NSImage(data); } catch (Exception e) { // just incase there is an error i didn't intend } } } if (image == null) { image = getImage("/images/message-32x32.png"); } growl.notifyGrowlOf("Message Received", image, name, message.getBody(), null); } catch (Exception e) { Logger.logError(e.getMessage(), e); } }
Dispatcher dispatcher = new Dispatcher(this); listener = new Listener(dispatcher);
Dispatcher dispatcher = new Dispatcher(); Listener listener = new Listener(dispatcher);
public DisplayedDocument(Shell shell) { // Shell this.shell = shell; shell.setText("Koala Notes"); shell.setLayout(new FillLayout(SWT.VERTICAL)); // Document document = new Document(); Note root = new Note("root", document, ""); LinkedList<Note> roots = new LinkedList<Note>(); roots.add(root); // Listener, Dispatcher, Controllers Dispatcher dispatcher = new Dispatcher(this); listener = new Listener(dispatcher); // Menu mainMenu = new MainMenu(shell, listener); // SashForm SashForm sashForm = new SashForm(shell, SWT.HORIZONTAL); // Tree tree = new NoteTree(sashForm, listener); tree.loadTree(roots); tree.init(); // TabFolder tabFolder = new NoteTabFolder(sashForm, listener); sashForm.setWeights(new int[] {20, 80}); }
dispatcher.registerController(new MainController(this)); dispatcher.registerController(new MainMenuController(this)); dispatcher.registerController(new TreeController(tree, dispatcher));
public DisplayedDocument(Shell shell) { // Shell this.shell = shell; shell.setText("Koala Notes"); shell.setLayout(new FillLayout(SWT.VERTICAL)); // Document document = new Document(); Note root = new Note("root", document, ""); LinkedList<Note> roots = new LinkedList<Note>(); roots.add(root); // Listener, Dispatcher, Controllers Dispatcher dispatcher = new Dispatcher(this); listener = new Listener(dispatcher); // Menu mainMenu = new MainMenu(shell, listener); // SashForm SashForm sashForm = new SashForm(shell, SWT.HORIZONTAL); // Tree tree = new NoteTree(sashForm, listener); tree.loadTree(roots); tree.init(); // TabFolder tabFolder = new NoteTabFolder(sashForm, listener); sashForm.setWeights(new int[] {20, 80}); }
public Listener(Controllers controllers) { this.controllers = controllers;
public Listener(Dispatcher dispatcher) { this.dispatcher = dispatcher;
public Listener(Controllers controllers) { this.controllers = controllers; srcToEvtToMethod = new HashMap<Widget, HashMap<Integer, String>>(); }
assertStringTemplateEquals ("#if(true){pass}\n\n#else{fail}", "pass"); assertStringTemplateEquals ("#if(true){pass} \n \n #else{fail}", "pass"); assertStringTemplateEquals ("#if(true){pass}\n\n\n\n\n\n\n\n\n\n#else{fail}", "pass"); assertStringTemplateEquals ("#if(true){pass} \n\n \n \n\n \n \n\n \n\n #else{fail}", "pass"); assertStringTemplateEquals ("#if(true){pass}\n \n \n \n \n \n \n\n \n\n#else{fail}", "pass");
public void testBeforeSubdirective () throws Exception { assertStringTemplateEquals ("#if(true){pass} #else{fail}", "pass"); assertStringTemplateEquals ("#if(true){pass} \n#else{fail}", "pass"); assertStringTemplateEquals ("#if(true){pass} \n #else{fail}", "pass"); }
setLayout(new CardLayout());
setLayout(new BorderLayout());
public ContactList() { // Load Local Preferences localPreferences = SettingsManager.getLocalPreferences(); offlineGroup = new ContactGroup("Offline Group"); JToolBar toolbar = new JToolBar(); toolbar.setFloatable(false); addContactMenu = new JMenuItem("Add Contact", SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); addContactGroupMenu = new JMenuItem("Add Contact Group", SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); removeContactFromGroupMenu = new JMenuItem("Remove from Group", SparkRes.getImageIcon(SparkRes.SMALL_DELETE)); chatMenu = new JMenuItem("Start a Chat", SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); renameMenu = new JMenuItem("Rename", SparkRes.getImageIcon(SparkRes.DESKTOP_IMAGE)); addContactMenu.addActionListener(this); removeContactFromGroupMenu.addActionListener(this); chatMenu.addActionListener(this); renameMenu.addActionListener(this); setLayout(new CardLayout()); addingGroupButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.ADD_CONTACT_IMAGE)); RolloverButton groupChatButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.JOIN_GROUPCHAT_IMAGE)); toolbar.add(addingGroupButton); toolbar.add(groupChatButton); addingGroupButton.addActionListener(this); mainPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false)); mainPanel.setBackground((Color)UIManager.get("List.background")); treeScroller = new JScrollPane(mainPanel); treeScroller.setBorder(BorderFactory.createEmptyBorder()); treeScroller.getVerticalScrollBar().setBlockIncrement(50); treeScroller.getVerticalScrollBar().setUnitIncrement(20); add(treeScroller, ROSTER_PANEL); retryPanel = new RetryPanel(); add(retryPanel, RETRY_PANEL); // Load Properties file props = new Properties(); // Save to properties file. propertiesFile = new File(new File(Spark.getUserHome(), "Spark"), "groups.properties"); try { props.load(new FileInputStream(propertiesFile)); } catch (IOException e) { // File does not exist. } // Add ActionListener(s) to menus addContactGroup(offlineGroup); showHideMenu.setSelected(false); // Add KeyMappings getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control N"), "searchContacts"); getActionMap().put("searchContacts", new AbstractAction("searchContacts") { public void actionPerformed(ActionEvent evt) { searchContacts(""); } }); // Save state on shutdown. SparkManager.getMainWindow().addMainWindowListener(new MainWindowListener() { public void shutdown() { saveState(); } public void mainWindowActivated() { } public void mainWindowDeactivated() { } }); SparkManager.getConnection().addConnectionListener(this); // Get command panel and add View Online/Offline, Add Contact StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); JPanel commandPanel = statusBar.getCommandPanel(); viewOnline = new RolloverButton(SparkRes.getImageIcon(SparkRes.VIEW_IMAGE)); commandPanel.add(viewOnline); viewOnline.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showEmptyGroups(!showHideMenu.isSelected()); } }); final RolloverButton addContactButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); commandPanel.add(addContactButton); addContactButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); }
add(treeScroller, ROSTER_PANEL);
retryPanel = new RetryPanel();
public ContactList() { // Load Local Preferences localPreferences = SettingsManager.getLocalPreferences(); offlineGroup = new ContactGroup("Offline Group"); JToolBar toolbar = new JToolBar(); toolbar.setFloatable(false); addContactMenu = new JMenuItem("Add Contact", SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); addContactGroupMenu = new JMenuItem("Add Contact Group", SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); removeContactFromGroupMenu = new JMenuItem("Remove from Group", SparkRes.getImageIcon(SparkRes.SMALL_DELETE)); chatMenu = new JMenuItem("Start a Chat", SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); renameMenu = new JMenuItem("Rename", SparkRes.getImageIcon(SparkRes.DESKTOP_IMAGE)); addContactMenu.addActionListener(this); removeContactFromGroupMenu.addActionListener(this); chatMenu.addActionListener(this); renameMenu.addActionListener(this); setLayout(new CardLayout()); addingGroupButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.ADD_CONTACT_IMAGE)); RolloverButton groupChatButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.JOIN_GROUPCHAT_IMAGE)); toolbar.add(addingGroupButton); toolbar.add(groupChatButton); addingGroupButton.addActionListener(this); mainPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false)); mainPanel.setBackground((Color)UIManager.get("List.background")); treeScroller = new JScrollPane(mainPanel); treeScroller.setBorder(BorderFactory.createEmptyBorder()); treeScroller.getVerticalScrollBar().setBlockIncrement(50); treeScroller.getVerticalScrollBar().setUnitIncrement(20); add(treeScroller, ROSTER_PANEL); retryPanel = new RetryPanel(); add(retryPanel, RETRY_PANEL); // Load Properties file props = new Properties(); // Save to properties file. propertiesFile = new File(new File(Spark.getUserHome(), "Spark"), "groups.properties"); try { props.load(new FileInputStream(propertiesFile)); } catch (IOException e) { // File does not exist. } // Add ActionListener(s) to menus addContactGroup(offlineGroup); showHideMenu.setSelected(false); // Add KeyMappings getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control N"), "searchContacts"); getActionMap().put("searchContacts", new AbstractAction("searchContacts") { public void actionPerformed(ActionEvent evt) { searchContacts(""); } }); // Save state on shutdown. SparkManager.getMainWindow().addMainWindowListener(new MainWindowListener() { public void shutdown() { saveState(); } public void mainWindowActivated() { } public void mainWindowDeactivated() { } }); SparkManager.getConnection().addConnectionListener(this); // Get command panel and add View Online/Offline, Add Contact StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); JPanel commandPanel = statusBar.getCommandPanel(); viewOnline = new RolloverButton(SparkRes.getImageIcon(SparkRes.VIEW_IMAGE)); commandPanel.add(viewOnline); viewOnline.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showEmptyGroups(!showHideMenu.isSelected()); } }); final RolloverButton addContactButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); commandPanel.add(addContactButton); addContactButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); }
retryPanel = new RetryPanel(); add(retryPanel, RETRY_PANEL);
workspace = SparkManager.getWorkspace(); workspace.getCardPanel().add(RETRY_PANEL, retryPanel); add(mainPanel, BorderLayout.CENTER);
public ContactList() { // Load Local Preferences localPreferences = SettingsManager.getLocalPreferences(); offlineGroup = new ContactGroup("Offline Group"); JToolBar toolbar = new JToolBar(); toolbar.setFloatable(false); addContactMenu = new JMenuItem("Add Contact", SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); addContactGroupMenu = new JMenuItem("Add Contact Group", SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); removeContactFromGroupMenu = new JMenuItem("Remove from Group", SparkRes.getImageIcon(SparkRes.SMALL_DELETE)); chatMenu = new JMenuItem("Start a Chat", SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); renameMenu = new JMenuItem("Rename", SparkRes.getImageIcon(SparkRes.DESKTOP_IMAGE)); addContactMenu.addActionListener(this); removeContactFromGroupMenu.addActionListener(this); chatMenu.addActionListener(this); renameMenu.addActionListener(this); setLayout(new CardLayout()); addingGroupButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.ADD_CONTACT_IMAGE)); RolloverButton groupChatButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.JOIN_GROUPCHAT_IMAGE)); toolbar.add(addingGroupButton); toolbar.add(groupChatButton); addingGroupButton.addActionListener(this); mainPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false)); mainPanel.setBackground((Color)UIManager.get("List.background")); treeScroller = new JScrollPane(mainPanel); treeScroller.setBorder(BorderFactory.createEmptyBorder()); treeScroller.getVerticalScrollBar().setBlockIncrement(50); treeScroller.getVerticalScrollBar().setUnitIncrement(20); add(treeScroller, ROSTER_PANEL); retryPanel = new RetryPanel(); add(retryPanel, RETRY_PANEL); // Load Properties file props = new Properties(); // Save to properties file. propertiesFile = new File(new File(Spark.getUserHome(), "Spark"), "groups.properties"); try { props.load(new FileInputStream(propertiesFile)); } catch (IOException e) { // File does not exist. } // Add ActionListener(s) to menus addContactGroup(offlineGroup); showHideMenu.setSelected(false); // Add KeyMappings getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control N"), "searchContacts"); getActionMap().put("searchContacts", new AbstractAction("searchContacts") { public void actionPerformed(ActionEvent evt) { searchContacts(""); } }); // Save state on shutdown. SparkManager.getMainWindow().addMainWindowListener(new MainWindowListener() { public void shutdown() { saveState(); } public void mainWindowActivated() { } public void mainWindowDeactivated() { } }); SparkManager.getConnection().addConnectionListener(this); // Get command panel and add View Online/Offline, Add Contact StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); JPanel commandPanel = statusBar.getCommandPanel(); viewOnline = new RolloverButton(SparkRes.getImageIcon(SparkRes.VIEW_IMAGE)); commandPanel.add(viewOnline); viewOnline.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { showEmptyGroups(!showHideMenu.isSelected()); } }); final RolloverButton addContactButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); commandPanel.add(addContactButton); addContactButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); }
CardLayout cl = (CardLayout)getLayout(); cl.show(this, ROSTER_PANEL);
workspace.changeCardLayout(Workspace.WORKSPACE_PANE);
public void clientReconnected() { XMPPConnection con = SparkManager.getConnection(); if (con.isConnected()) { // Send Available status final Presence presence = SparkManager.getWorkspace().getStatusBar().getPresence(); SparkManager.getSessionManager().changePresence(presence); final Roster roster = con.getRoster(); final Iterator rosterEntries = roster.getEntries(); while (rosterEntries.hasNext()) { RosterEntry entry = (RosterEntry)rosterEntries.next(); updateUserPresence(roster.getPresence(entry.getUser())); } } CardLayout cl = (CardLayout)getLayout(); cl.show(this, ROSTER_PANEL); }
CardLayout cl = (CardLayout)getLayout(); cl.show(this, RETRY_PANEL);
workspace.changeCardLayout(RETRY_PANEL);
private void reconnect(final String message, final boolean conflict) { // Show MainWindow SparkManager.getMainWindow().setVisible(true); // Flash That Window. SparkManager.getAlertManager().flashWindowStopOnFocus(SparkManager.getMainWindow()); if (reconnectListener == null) { reconnectListener = new RetryPanel.ReconnectListener() { public void reconnected() { clientReconnected(); } public void cancelled() { removeAllUsers(); } }; retryPanel.addReconnectionListener(reconnectListener); } // Show reconnect panel CardLayout cl = (CardLayout)getLayout(); cl.show(this, RETRY_PANEL); retryPanel.setDisconnectReason(message); if (!conflict) { retryPanel.startTimer(); } else { retryPanel.showConflict(); } }
CardLayout cardLayout = (CardLayout)getLayout(); cardLayout.show(this, ROSTER_PANEL);
workspace.changeCardLayout(RETRY_PANEL);
private void removeAllUsers() { // Show reconnect panel CardLayout cardLayout = (CardLayout)getLayout(); cardLayout.show(this, ROSTER_PANEL); // Behind the scenes, move everyone to the offline group. Iterator contactGroups = new ArrayList(getContactGroups()).iterator(); while (contactGroups.hasNext()) { ContactGroup contactGroup = (ContactGroup)contactGroups.next(); Iterator contactItems = new ArrayList(contactGroup.getContactItems()).iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); contactGroup.removeContactItem(item); } } }
version1 = version1.replaceAll(".online", "");
public boolean isGreater(String version1, String version2) { return version1.compareTo(version2) >= 1; }
setBackground(Color.black);
setBackground(Color.white);
public TitlePanel(String title, String description, Icon icon, boolean showDescription) { // Set the icon iconLabel.setIcon(icon); // Set the title setTitle(title); // Set the description setDescription(description); setLayout(gridBagLayout); if (showDescription) { add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(descriptionLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 9, 5, 5), 0, 0)); add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); setBackground(Color.black); titleLabel.setFont(new Font("dialog", Font.BOLD, 11)); descriptionLabel.setFont(new Font("dialog", 0, 10)); } else { final JPanel panel = new ImagePanel(); panel.setBorder(BorderFactory.createEtchedBorder()); panel.setLayout(new GridBagLayout()); panel.add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0)); panel.add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0)); titleLabel.setVerticalTextPosition(JLabel.CENTER); titleLabel.setFont(new Font("dialog", Font.BOLD, 14)); titleLabel.setForeground(Color.black); descriptionLabel.setFont(new Font("dialog", 0, 10)); add(panel, new GridBagConstraints(0, 0, 1, 0, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 2, 2, 2), 0, 0)); } }
List metadataProviders = new ArrayList(2); metadataProviders.add(new GeronimoMetadataProvider()); metadataProviders.add(new PropertiesMetadataProvider()); MetadataManager metadataManager = new SimpleMetadataManager(metadataProviders);
public ObjectName load(Kernel kernel, String location) { try { LiveHashSet repositories = new LiveHashSet(kernel, "repositories", Collections.singleton(new ObjectName("*:j2eeType=Repository,*"))); repositories.start(); ConfigurationInfo configurationInfo = loadConfigurationInfo(location); final ClassLoader classLoader = ConfigurationUtil.createClassLoader(configurationInfo.getConfigurationId(), configurationInfo.getDependencies(), getClass().getClassLoader(), repositories); DefaultListableBeanFactory factory = new DefaultListableBeanFactory(); try { Resource resource = new FileSystemResource(new File(location)); XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(factory) { public ClassLoader getBeanClassLoader() { return classLoader; } }; reader.loadBeanDefinitions(resource); } catch (BeansException e) { // not a spring file return null; } // convert properties into named constructor args List metadataProviders = new ArrayList(2); metadataProviders.add(new GeronimoMetadataProvider()); metadataProviders.add(new PropertiesMetadataProvider()); MetadataManager metadataManager = new SimpleMetadataManager(metadataProviders); NamedConstructorArgs namedConstructorArgs = new NamedConstructorArgs(metadataManager); namedConstructorArgs.postProcessBeanFactory(factory); // create object names for all of the beans ObjectNameBuilder objectNameBuilder = new ObjectNameBuilder(metadataManager, configurationInfo.getDomain(), configurationInfo.getServer(), configurationInfo.getConfigurationId().toString()); objectNameBuilder.postProcessBeanFactory(factory); // auto detect the livecycle methods (todo this needs work) LifecycleDetector lifecycleDetector = new LifecycleDetector(); lifecycleDetector.addLifecycleInterface(SimpleLifecycle.class, "start", "stop"); lifecycleDetector.addLifecycleInterface(org.apache.geronimo.gbean.GBeanLifecycle.class, "doStart", "doStop"); lifecycleDetector.postProcessBeanFactory(factory); Map serviceFactories = new LinkedHashMap(); String[] beanDefinitionNames = factory.getBeanDefinitionNames(); if (beanDefinitionNames != null) { for (int i = 0; i < beanDefinitionNames.length; i++) { String beanName = beanDefinitionNames[i]; BeanDefinition beanDefinition = factory.getBeanDefinition(beanName); ServiceFactory serviceFactory = new SpringServiceFactory((RootBeanDefinition) beanDefinition, objectNameBuilder.getObjectNameMap()); ObjectName objectName = objectNameBuilder.getObjectName(beanName); serviceFactories.put(objectName, serviceFactory); } } SpringConfiguration springConfiguration = new SpringConfiguration(kernel, configurationInfo, serviceFactories, classLoader); SimpleServiceFactory springServiceFactory = new SimpleServiceFactory(springConfiguration); ObjectName configurationObjectName = springConfiguration.getObjectName(); kernel.loadService(configurationObjectName, springServiceFactory, classLoader); return configurationObjectName; } catch (Exception e) { throw new InvalidConfigurationException("Unable to load configuration: " + location, e); } }
} catch (InvalidConfigurationException e) { throw e;
public ObjectName load(Kernel kernel, String location) { try { LiveHashSet repositories = new LiveHashSet(kernel, "repositories", Collections.singleton(new ObjectName("*:j2eeType=Repository,*"))); repositories.start(); ConfigurationInfo configurationInfo = loadConfigurationInfo(location); final ClassLoader classLoader = ConfigurationUtil.createClassLoader(configurationInfo.getConfigurationId(), configurationInfo.getDependencies(), getClass().getClassLoader(), repositories); DefaultListableBeanFactory factory = new DefaultListableBeanFactory(); try { Resource resource = new FileSystemResource(new File(location)); XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(factory) { public ClassLoader getBeanClassLoader() { return classLoader; } }; reader.loadBeanDefinitions(resource); } catch (BeansException e) { // not a spring file return null; } // convert properties into named constructor args List metadataProviders = new ArrayList(2); metadataProviders.add(new GeronimoMetadataProvider()); metadataProviders.add(new PropertiesMetadataProvider()); MetadataManager metadataManager = new SimpleMetadataManager(metadataProviders); NamedConstructorArgs namedConstructorArgs = new NamedConstructorArgs(metadataManager); namedConstructorArgs.postProcessBeanFactory(factory); // create object names for all of the beans ObjectNameBuilder objectNameBuilder = new ObjectNameBuilder(metadataManager, configurationInfo.getDomain(), configurationInfo.getServer(), configurationInfo.getConfigurationId().toString()); objectNameBuilder.postProcessBeanFactory(factory); // auto detect the livecycle methods (todo this needs work) LifecycleDetector lifecycleDetector = new LifecycleDetector(); lifecycleDetector.addLifecycleInterface(SimpleLifecycle.class, "start", "stop"); lifecycleDetector.addLifecycleInterface(org.apache.geronimo.gbean.GBeanLifecycle.class, "doStart", "doStop"); lifecycleDetector.postProcessBeanFactory(factory); Map serviceFactories = new LinkedHashMap(); String[] beanDefinitionNames = factory.getBeanDefinitionNames(); if (beanDefinitionNames != null) { for (int i = 0; i < beanDefinitionNames.length; i++) { String beanName = beanDefinitionNames[i]; BeanDefinition beanDefinition = factory.getBeanDefinition(beanName); ServiceFactory serviceFactory = new SpringServiceFactory((RootBeanDefinition) beanDefinition, objectNameBuilder.getObjectNameMap()); ObjectName objectName = objectNameBuilder.getObjectName(beanName); serviceFactories.put(objectName, serviceFactory); } } SpringConfiguration springConfiguration = new SpringConfiguration(kernel, configurationInfo, serviceFactories, classLoader); SimpleServiceFactory springServiceFactory = new SimpleServiceFactory(springConfiguration); ObjectName configurationObjectName = springConfiguration.getObjectName(); kernel.loadService(configurationObjectName, springServiceFactory, classLoader); return configurationObjectName; } catch (Exception e) { throw new InvalidConfigurationException("Unable to load configuration: " + location, e); } }
public InvalidConfigurationException(String s, Throwable throwable) { super(s, throwable);
public InvalidConfigurationException() {
public InvalidConfigurationException(String s, Throwable throwable) { super(s, throwable); }
public void visitBeanDefinition(BeanDefinition beanDefinition) throws BeansException { super.visitBeanDefinition(beanDefinition);
public void visitBeanDefinition(BeanDefinition beanDefinition, Object data) throws BeansException { super.visitBeanDefinition(beanDefinition, data);
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { SpringVisitor visitor = new AbstractSpringVisitor() { public void visitBeanDefinition(BeanDefinition beanDefinition) throws BeansException { super.visitBeanDefinition(beanDefinition); if (!(beanDefinition instanceof RootBeanDefinition)) { return; } RootBeanDefinition rootBeanDefinition = ((RootBeanDefinition) beanDefinition); parametersToConstructorArgs(rootBeanDefinition); } }; visitor.visitBeanFactory(beanFactory); }
parametersToConstructorArgs(rootBeanDefinition);
processParameters(rootBeanDefinition);
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { SpringVisitor visitor = new AbstractSpringVisitor() { public void visitBeanDefinition(BeanDefinition beanDefinition) throws BeansException { super.visitBeanDefinition(beanDefinition); if (!(beanDefinition instanceof RootBeanDefinition)) { return; } RootBeanDefinition rootBeanDefinition = ((RootBeanDefinition) beanDefinition); parametersToConstructorArgs(rootBeanDefinition); } }; visitor.visitBeanFactory(beanFactory); }
visitor.visitBeanFactory(beanFactory);
visitor.visitBeanFactory(beanFactory, null);
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { SpringVisitor visitor = new AbstractSpringVisitor() { public void visitBeanDefinition(BeanDefinition beanDefinition) throws BeansException { super.visitBeanDefinition(beanDefinition); if (!(beanDefinition instanceof RootBeanDefinition)) { return; } RootBeanDefinition rootBeanDefinition = ((RootBeanDefinition) beanDefinition); parametersToConstructorArgs(rootBeanDefinition); } }; visitor.visitBeanFactory(beanFactory); }
public ObjectNameBuilder(MetadataManager metadataManager, String domainName, String serverName, String applicationName) {
public ObjectNameBuilder(MetadataManager metadataManager, String domainName, String serverName, String moduleName) {
public ObjectNameBuilder(MetadataManager metadataManager, String domainName, String serverName, String applicationName) { this.metadataManager = metadataManager; this.domainName = domainName; this.serverName = serverName; this.applicationName = applicationName; }
this.applicationName = applicationName;
this.moduleName = moduleName;
public ObjectNameBuilder(MetadataManager metadataManager, String domainName, String serverName, String applicationName) { this.metadataManager = metadataManager; this.domainName = domainName; this.serverName = serverName; this.applicationName = applicationName; }
public void visitBeanDefinition(BeanDefinition beanDefinition) throws BeansException { super.visitBeanDefinition(beanDefinition);
public void visitBeanDefinition(BeanDefinition beanDefinition, Object data) throws BeansException { super.visitBeanDefinition(beanDefinition, data);
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { SpringVisitor visitor = new AbstractSpringVisitor() { public void visitBeanDefinition(BeanDefinition beanDefinition) throws BeansException { super.visitBeanDefinition(beanDefinition); if (!(beanDefinition instanceof RootBeanDefinition)) { return; } RootBeanDefinition rootBeanDefinition = ((RootBeanDefinition) beanDefinition); Class beanType = rootBeanDefinition.getBeanClass(); for (Iterator iterator = lifecycleMap.entrySet().iterator(); iterator.hasNext();) { Map.Entry entry = (Map.Entry) iterator.next(); Class lifecycleInterface = (Class) entry.getKey(); LifecycleMethods value = (LifecycleMethods) entry.getValue(); if (lifecycleInterface.isAssignableFrom(beanType)) { if (rootBeanDefinition.getInitMethodName() == null) { rootBeanDefinition.setInitMethodName(value.initMethodName); } if (rootBeanDefinition.getDestroyMethodName() == null) { rootBeanDefinition.setDestroyMethodName(value.destroyMethodName); } if (rootBeanDefinition.getInitMethodName() != null && rootBeanDefinition.getDestroyMethodName() != null) { return; } } } } }; visitor.visitBeanFactory(beanFactory); }
visitor.visitBeanFactory(beanFactory);
visitor.visitBeanFactory(beanFactory, null);
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { SpringVisitor visitor = new AbstractSpringVisitor() { public void visitBeanDefinition(BeanDefinition beanDefinition) throws BeansException { super.visitBeanDefinition(beanDefinition); if (!(beanDefinition instanceof RootBeanDefinition)) { return; } RootBeanDefinition rootBeanDefinition = ((RootBeanDefinition) beanDefinition); Class beanType = rootBeanDefinition.getBeanClass(); for (Iterator iterator = lifecycleMap.entrySet().iterator(); iterator.hasNext();) { Map.Entry entry = (Map.Entry) iterator.next(); Class lifecycleInterface = (Class) entry.getKey(); LifecycleMethods value = (LifecycleMethods) entry.getValue(); if (lifecycleInterface.isAssignableFrom(beanType)) { if (rootBeanDefinition.getInitMethodName() == null) { rootBeanDefinition.setInitMethodName(value.initMethodName); } if (rootBeanDefinition.getDestroyMethodName() == null) { rootBeanDefinition.setDestroyMethodName(value.destroyMethodName); } if (rootBeanDefinition.getInitMethodName() != null && rootBeanDefinition.getDestroyMethodName() != null) { return; } } } } }; visitor.visitBeanFactory(beanFactory); }
add(textLabel, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(3, 2, 3, 5), 0, 0));
add(textLabel, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(3, 2, 3, 10), 0, 0));
public SparkTab(Icon icon, String text) { setLayout(new GridBagLayout()); selectedBorderColor = new Color(173, 0, 0); // setBackground(backgroundColor); this.actualText = text; iconLabel = new JLabel(icon); iconLabel.setOpaque(false); textLabel = new JLabel(text); // add Label add(iconLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(3, 2, 3, 2), 0, 0)); // add text label add(textLabel, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(3, 2, 3, 5), 0, 0)); // Set fonts defaultFont = new Font("Dialog", Font.PLAIN, 11); textLabel.setFont(defaultFont); }
_log.warning ("TemplateProvider: Template not found: " + fileName, npe);
_log.warning ("TemplateProvider: Template not found: " + fileName);
final public Template getTemplate(String fileName) { File tFile = findTemplate (fileName); Template t = null; try { t = new FileTemplate (_broker, tFile); t.parse (); _lastModifiedCache.put (fileName, new Long (tFile.lastModified())); return t; } catch (NullPointerException npe) { _log.warning ("TemplateProvider: Template not found: " + fileName, npe); } catch (Exception e) { // this probably occured b/c of a parsing error. // should throw some kind of ParseErrorException here instead _log.warning ("TemplateProvider: Error occured while getting " + fileName, e); } return null; }
if (_templatePath == null) { _log.error("TemplatePath not specified in properties"); _templatePath = ""; }
public void init(Broker b, Settings config) throws InitException { super.init(b,config); _broker = b; _log = b.getLog("resource", "Object loading and caching"); try { _cacheDuration = config.getIntegerSetting("TemplateExpireTime", 0); _templatePath = config.getSetting("TemplatePath"); StringTokenizer st = new StringTokenizer(_templatePath, _pathSeparator); _templateDirectory = new String[ st.countTokens() ]; int i; for (i=0; i < _templateDirectory.length; i++) { String dir = st.nextToken(); _templateDirectory[i] = dir; } } catch(Exception e) { throw new InitException("Could not initialize",e); } }
public int getIntegerSetting(String key, int defaultValue) { if (containsKey(key)) { return getIntegerSetting(key); } else { return defaultValue;
public int getIntegerSetting(String key) { String snum = getSetting(key); try { return Integer.parseInt(snum); } catch (Exception e) { return 0;
public int getIntegerSetting(String key, int defaultValue) { if (containsKey(key)) { return getIntegerSetting(key); } else { return defaultValue; } }
setBackground(Color.white);
setBackground(Color.black);
public TitlePanel(String title, String description, Icon icon, boolean showDescription) { // Set the icon iconLabel.setIcon(icon); // Set the title setTitle(title); // Set the description setDescription(description); setLayout(gridBagLayout); if (showDescription) { add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(descriptionLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 9, 5, 5), 0, 0)); add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); setBackground(Color.white); titleLabel.setFont(new Font("Verdana", Font.BOLD, 11)); descriptionLabel.setFont(new Font("Verdana", 0, 10)); } else { final JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createEtchedBorder()); panel.setLayout(new GridBagLayout()); panel.add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); panel.add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); panel.setBackground(new Color(49, 106, 197)); titleLabel.setFont(new Font("Verdana", Font.BOLD, 13)); titleLabel.setForeground(Color.white); descriptionLabel.setFont(new Font("Verdana", 0, 10)); add(panel, new GridBagConstraints(0, 0, 1, 0, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0)); } }
titleLabel.setFont(new Font("Verdana", Font.BOLD, 11)); descriptionLabel.setFont(new Font("Verdana", 0, 10));
titleLabel.setFont(new Font("dialog", Font.BOLD, 11)); descriptionLabel.setFont(new Font("dialog", 0, 10));
public TitlePanel(String title, String description, Icon icon, boolean showDescription) { // Set the icon iconLabel.setIcon(icon); // Set the title setTitle(title); // Set the description setDescription(description); setLayout(gridBagLayout); if (showDescription) { add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(descriptionLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 9, 5, 5), 0, 0)); add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); setBackground(Color.white); titleLabel.setFont(new Font("Verdana", Font.BOLD, 11)); descriptionLabel.setFont(new Font("Verdana", 0, 10)); } else { final JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createEtchedBorder()); panel.setLayout(new GridBagLayout()); panel.add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); panel.add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); panel.setBackground(new Color(49, 106, 197)); titleLabel.setFont(new Font("Verdana", Font.BOLD, 13)); titleLabel.setForeground(Color.white); descriptionLabel.setFont(new Font("Verdana", 0, 10)); add(panel, new GridBagConstraints(0, 0, 1, 0, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0)); } }
final JPanel panel = new JPanel();
final JPanel panel = new ImagePanel();
public TitlePanel(String title, String description, Icon icon, boolean showDescription) { // Set the icon iconLabel.setIcon(icon); // Set the title setTitle(title); // Set the description setDescription(description); setLayout(gridBagLayout); if (showDescription) { add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(descriptionLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 9, 5, 5), 0, 0)); add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); setBackground(Color.white); titleLabel.setFont(new Font("Verdana", Font.BOLD, 11)); descriptionLabel.setFont(new Font("Verdana", 0, 10)); } else { final JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createEtchedBorder()); panel.setLayout(new GridBagLayout()); panel.add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); panel.add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); panel.setBackground(new Color(49, 106, 197)); titleLabel.setFont(new Font("Verdana", Font.BOLD, 13)); titleLabel.setForeground(Color.white); descriptionLabel.setFont(new Font("Verdana", 0, 10)); add(panel, new GridBagConstraints(0, 0, 1, 0, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0)); } }