⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 toolmanager.cpp

📁 用bcg库编写的java IDE 源码
💻 CPP
📖 第 1 页 / 共 2 页
字号:
		}
	  }lszpList->SetAt(strName,strOptions);
   }
   m_bModified = FALSE;
}



void CToolManager::AcquireDataToRunJavaw(CMapStringToString* lpCommands)
{
   XMLelement* pXMLJavaw = GetXMLObject("javaw");
   
   XMLelement* pXMLClsFiles = pXMLJavaw->m_lNestedElements.GetHead();
   for(POSITION pos = pXMLClsFiles->m_lNestedElements.GetHeadPosition(); pos !=NULL;)
   {
      XMLelement* pXMLCls = pXMLClsFiles->m_lNestedElements.GetNext(pos);
	  CString strClsName   = pXMLCls->m_lAttributes.GetHead()->m_strValue;
	  CString strPrompt = pXMLCls->m_lAttributes.GetTail()->m_strValue;
	  CString strOptions;

	  strClsName.TrimRight(".class");

	  XMLelement* pXMLOptions = pXMLCls->m_lNestedElements.GetHead();
	  for(POSITION _pos = pXMLOptions->m_lNestedElements.GetHeadPosition(); _pos !=NULL;)
	  {
        XMLelement* pXMLOpt = pXMLOptions->m_lNestedElements.GetNext(_pos);
		POSITION __pos = pXMLOpt->m_lAttributes.GetHeadPosition();
        CString strName  = pXMLOpt->m_lAttributes.GetNext(__pos)->m_strValue;
		CString strCheck = pXMLOpt->m_lAttributes.GetNext(__pos)->m_strValue;
        CString strArgs;

        if(strCheck.Compare("1") == 0)
		{
           if(__pos)
              strArgs = pXMLOpt->m_lAttributes.GetNext(__pos)->m_strValue;

           if(strName.Compare("-classpath") == 0)
             strOptions +=" -classpath "+strArgs;
		   else
		   if(strName.Compare("-D") == 0)
             strOptions +=" -D "+strArgs;
		   else
		   if(strName.Compare("-enableassertions") == 0)
             strOptions +=" -enableassertions "+strArgs;
		   else
		   if(strName.Compare("-disableassertions") == 0)
             strOptions +=" -disableassertions: "+strArgs;
		   else
		   if(strName.Compare("-Xbootclasspath") == 0)
             strOptions +=" -Xbootclasspath "+strArgs;
		   else
		   if(strName.Compare("-Xbootclasspath/a:") == 0)
              strOptions +=" -Xbootclasspath/a: "+strArgs;
		   else
		   if(strName.Compare("-Xbootclasspath/p:") == 0)
             strOptions +=" -Xbootclasspath/p: "+strArgs;
		   else
		   if(strName.Compare("-bootclasspath") == 0)
             strOptions +=" -bootclasspath "+strArgs;
		   else
		   if(strName.Compare("-Xloggc:") == 0)
             strOptions +=" -Xloggc: "+strArgs;
		   else
		   if(strName.Compare("-Xstdout") == 0)
             strOptions +=" -Xstdout "+strArgs;
		   else
		   if(strName.Compare("-Xms") == 0)
             strOptions +=" -Xms "+strArgs;
		   else
		   if(strName.Compare("-Xmxn") == 0)
             strOptions +=" -Xmxn "+strArgs;
		   else
		   if(strName.Compare("-Xrunhprof") == 0)
             strOptions +=" -Xrunhprof "+strArgs;
		}
	  }
		strOptions +=" "+strClsName;
		lpCommands->SetAt(strOptions,strPrompt);
   }
}

XMLelement* CToolManager::GetXMLObject(CString strName)
{
  if(m_lxmlSettings.GetCount())
  {
    XMLelement* pXMLTools = m_lxmlSettings.GetHead();
    for(POSITION pos = pXMLTools->m_lNestedElements.GetHeadPosition(); pos != NULL;)
	{
      XMLelement* pElement = pXMLTools->m_lNestedElements.GetNext(pos);
	  if(pElement->m_strElementName.Compare(strName) == 0)
	    return pElement;
	}  
  }
  else
  {
    XMLelement* pXMLTools = new XMLelement;pXMLTools->m_strElementName = "tools";
	m_lxmlSettings.AddHead(pXMLTools);
  }return 0;
}

void CToolManager::Create(CString strfile,CString strProjectName,CString strHomePath)
{
   CString strClassPath = strHomePath;
   strClassPath += "ClassFiles";
   
   CString strFile  = strProjectName+".java";
   CString strClass = strProjectName+".class";
   CString strSrcPath = strHomePath;
   strSrcPath.TrimLeft();strSrcPath.TrimRight();
   strSrcPath.TrimRight('\\');

   //write settings to file
   CStdioFile reader_writer;
   if(!reader_writer.Open(strfile,CFile::modeWrite|CFile::modeCreate))
   {
	 MessageBox(0,"failed to create toolmanager","error",MB_OK|MB_ICONERROR);
     return;
   }
   reader_writer.WriteString("<!--BugfreeSoft Visual Java IDE Project tools Setting File-->\n");
   reader_writer.WriteString("<!--PLEASE DO NOT EDIT THIS FILE, IF U'D LIKE YOUR PRODUCT TO WORK CORRECTLY, OTHERWISE GO RIGHT AHEAD:)-->\n\n\n");
   
   reader_writer.WriteString("<tools>\n");
   reader_writer.WriteString("  <javac configsrc=\"0\">\n");
   reader_writer.WriteString("    <srcFiles>\n");
   reader_writer.WriteString("      <file  name= \""+strFile+"\">\n");
   reader_writer.WriteString("        <options>\n");


   reader_writer.WriteString("          <option name = \"-classpath\" check = \"1\" args= \""+strClassPath+"\"/>\n");
   reader_writer.WriteString("          <option name = \"-d\" check = \"1\" args= \""+strClassPath+"\"/>\n");
   reader_writer.WriteString("          <option name = \"-deprecation\" check = \"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-encoding\" check = \"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-g\" check = \"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-g:none\" check = \"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-g:{keyword list}\" check = \"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-help\" check = \"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-nowarn\" check = \"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-source\" check = \"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-sourcepath\" check = \"1\" args= \""+strSrcPath+"\"/>\n");
   reader_writer.WriteString("          <option name = \"-verbose\" check = \"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-target\" check = \"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-bootclasspath\" check = \"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-extdirs\" check = \"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-Xstdout\" check = \"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-Xswitchcheck\" check = \"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-J\" check = \"0\"/>\n");
   
   reader_writer.WriteString("        </options>\n");
   reader_writer.WriteString("      </file>\n");
   reader_writer.WriteString("    </srcFiles>\n");
   reader_writer.WriteString(" </javac>\n");

   reader_writer.WriteString(" <javaw>\n");
   reader_writer.WriteString("    <classFiles>\n");
   reader_writer.WriteString("      <file  name= \""+strClass+"\" prompt=\"no\">\n");
   reader_writer.WriteString("        <options>\n");


   reader_writer.WriteString("          <option name = \"-client\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-server\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-classpath\" check =\"1\" args=\""+strClassPath+"\"/>\n");
   reader_writer.WriteString("          <option name = \"-D\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-enableassertions\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-disableassertions\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-enablesystemassertions\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-disablesystemassertions\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-jar\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-verbose\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-verbose:class\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-verbose:gc\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-verbose:jni\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-version\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-showversion\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-help\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-X\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-Xmixed\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-Xint\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-Xdebug\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-Xbootclasspath\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-Xbootclasspath/a\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-Xbootclasspath/p\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-Xcheck:jni\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-Xconcgc\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-Xfuture\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-Xnoclassgc\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-Xincgc\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-Xloggc\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-Xms\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-Xmx\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-Xprof\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-Xrunhprof\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-Xrunjdwp\" check =\"0\"/>\n");
   reader_writer.WriteString("          <option name = \"-Xrs\" check =\"0\"/>\n");


   reader_writer.WriteString("        </options>\n");
   reader_writer.WriteString("      </file>\n");
   reader_writer.WriteString("    </classFiles>\n");
   reader_writer.WriteString(" </javaw>\n");
   reader_writer.WriteString("</tools>\n");
   reader_writer.Close();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -