2016-09-16 106 views
0

我有一個非常古老的3.X RCP Eclipse項目,我試圖升級到4,但是我想修復項目的最初問題是使樣式匹配RCP經典CSS。我試過以下:http://www.eclipse.org/forums/index.php/m/1034649/?srch=3.x+rcp+theme+css#msg_1034649創建相同的風格,但無濟於事,所以我只能假設我做錯了什麼(驚喜)。我對RCP很新,所以請原諒這個解釋。鏈接講話擴展點增加,我在我的project.product文件中看到,但不知道如何添加它,所以我將它添加到plugin.xml中。總體而言,我希望有一個更好的理解,以便在解決其他一些問題之前至少完成樣式。Eclipse RCP 3.X到4 - 經典CSS

添加plugin.xml中:

<?eclipse version="3.2"?> 
<plugin> 
<extension point="org.eclipse.ui.activities"> 
    <activity name="Remove Unused Icons Manager" id="activity.removeUnusedIcons" /> 
    <activityPatternBinding 
     activityId="activity.removeUnusedIcons" 
     pattern="org\.eclipse\.ui\.editors/org\.eclipse\.ui\.edit\.text\.gotoLastEditPosition"> 
    </activityPatternBinding> 
</extension> 

<extension 
    id="application" 
    point="org.eclipse.core.runtime.applications"> 
    <application> 
    <run 
      class="com.company.project.client.application.Application"> 
    </run> 
    </application> 
</extension> 

<extension point="org.eclipse.ui.perspectives"> 
<perspective 
     class="com.company.project.client.perspectives.Perspective" 
     fixed="false" 
     icon="icons/project.png" 
     id="project.perspectives.Default" 
     name="PROJECT Perspective(Default)"> 
    </perspective> 
    <perspective 
     class="com.company.project.client.perspectives.ImportPerspective" 
     fixed="false" 
     icon="icons/project.png" 
     id="project.perspectives.ImportPerspective" 
     name="Import Perspective"> 
    </perspective> 
    </extension> 
    <extension 
    point="org.eclipse.ui.views"> 
    <view 
     allowMultiple="true" 
     category="PROJECT" 
     class="com.company.project.client.views.View" 
     icon="icons/project.png" 
     id="PROJECT.view" 
     name="Start Page"> 
    </view> 
    <category 
     id="PROJECT" 
     name="Sample Category"> 
    </category> 
</extension> 
<extension 
    point="org.eclipse.ui.commands"> 
    <category 
     name="Mail" 
     id="PROJECT.category"> 
    </category> 
    <command 
     name="Open Mailbox" 
     description="Opens a mailbox" 
     categoryId="PROJECT.category" 
     id="PROJECT.open"> 
    </command> 
    <command 
     name="TOGGLE DEFAULT" 
     class="org.eclipse.ui.handlers.RegistryToggleState: false" 
     id="org.eclipse.ui.commands.toggleState"> 
    </command> 
    <command 
     name="Open Message Dialog" 
     description="Open a message dialog" 
     categoryId="PROJECT.category" 
     id="PROJECT.openMessage"> 
    </command> 
    <command 
     categoryId="PROJECT.category" 
     description="Opens a new PROJECT Project" 
     id="PROJECT.newProject" 
     name="New Project"> 
    </command> 
    <command 
     categoryId="PROJECT.category" 
     description="Opens a new PROJECT Module" 
     id="PROJECT.newModule" 
     name="New Module"> 
    </command> 
    <command 
     categoryId="PROJECT.category" 
     description="Imports data into PROJECT" 
     id="PROJECT.importData" 
     name="Import Data"> 
    </command> 
    <command 
     categoryId="PROJECT.category" 
     description="Cancels a data import" 
     id="PROJECT.cancelImport" 
     name="Cancel Import"> 
    </command> 
    <command 
     categoryId="PROJECT.category" 
     description="Shows the Number Format Dialog" 
     id="PROJECT.showNumberFormatDialog" 
     name="Number Format Dialog"> 
    </command> 
</extension> 
<extension 
    point="org.eclipse.ui.bindings"> 
    <key 
     commandId="org.eclipse.ui.file.exit" 
     schemeId="org.eclipse.ui.defaultAcceleratorConfiguration" 
     sequence="ALT+F4"> 
    </key> 
</extension> 
<extension 
    id="PROJECT.product" 
    point="org.eclipse.core.runtime.products"> 
    <product 
     application="PROJECT.application" 
     name="PROJECT: DESCRIPTION v1.1.2"> 
    <property 
      name="aboutText" 
      value="PROJECT: DESCRIPTION v1.1.2"> 
    </property> 
    <property 
     name="csstheme" 
     value="org.eclipse.e4.ui.css.theme.e4_classic"> 
    </property> 
    <property 
     name="applicationcssResources" 
     value="images/css/"> 
    </property> 
    <property 
      name="windowImages" 
      value="icons/CERView.gif"> 
    </property> 
    <property 
      name="aboutImage" 
      value="images\logo.png"> 
    </property> 
    <property 
      name="appName" 
      value="PROJECT: DESCRIPTION v1.1.2"> 
    </property> 
    </product> 
</extension> 
<extension 
    point="org.eclipse.ui.perspectiveExtensions"> 
    <perspectiveExtension 
     targetID="org.eclipse.ui.resourcePerspective"> 
    <view 
      id="project.views.Globals" 
      ratio="0.5" 
      relationship="right" 
      relative="org.eclipse.ui.views.TaskList"> 
    </view> 
    </perspectiveExtension> 
    <perspectiveExtension 
     targetID="org.eclipse.ui.resourcePerspective"> 
    <view 
      id="project.views.ProjectView" 
      ratio="0.5" 
      relationship="right" 
      relative="org.eclipse.ui.views.TaskList"> 
    </view> 
    </perspectiveExtension> 
    <perspectiveExtension 
     targetID="org.eclipse.ui.resourcePerspective"> 
    <view 
      id="project.views.Console" 
      ratio="0.5" 
      relationship="right" 
      relative="org.eclipse.ui.views.TaskList"> 
    </view> 
    </perspectiveExtension> 
    <perspectiveExtension 
     targetID="org.eclipse.ui.resourcePerspective"> 
    <view 
      id="project.views.LinkagesView" 
      ratio="0.5" 
      relationship="right" 
      relative="org.eclipse.ui.views.TaskList"> 
    </view> 
    </perspectiveExtension> 
    <perspectiveExtension 
     targetID="org.eclipse.ui.resourcePerspective"> 
    <view 
      id="project.views.Tasks" 
      ratio="0.5" 
      relationship="right" 
      relative="org.eclipse.ui.views.TaskList"> 
    </view> 
    </perspectiveExtension> 
    <perspectiveExtension 
     targetID="org.eclipse.ui.resourcePerspective"> 
    <view 
      id="project.views.Updates" 
      ratio="0.5" 
      relationship="right" 
      relative="org.eclipse.ui.views.TaskList"> 
    </view> 
    </perspectiveExtension> 
    <perspectiveExtension 
     targetID="org.eclipse.ui.resourcePerspective"> 
    <view 
      id="project.views.CalculationElements" 
      ratio="0.5" 
      relationship="right" 
      relative="org.eclipse.ui.views.TaskList"> 
    </view> 
    </perspectiveExtension> 
    <perspectiveExtension 
     targetID="org.eclipse.ui.resourcePerspective"> 
    <view 
      id="project.views.History" 
      ratio="0.5" 
      relationship="right" 
      relative="org.eclipse.ui.views.TaskList"> 
    </view> 
    </perspectiveExtension> 
    <perspectiveExtension 
     targetID="org.eclipse.ui.resourcePerspective"> 
    <view 
      id="project.views.Excel" 
      ratio="0.5" 
      relationship="right" 
      relative="org.eclipse.ui.views.TaskList"> 
    </view> 
    </perspectiveExtension> 
    <perspectiveExtension 
     targetID="org.eclipse.ui.resourcePerspective"> 
    <view 
      id="project.views.ImportDataMappingView" 
      ratio="0.5" 
      relationship="right" 
      relative="org.eclipse.ui.views.TaskList"> 
    </view> 
    </perspectiveExtension> 
    <perspectiveExtension 
     targetID="org.eclipse.ui.resourcePerspective"> 
    <view 
      id="project.views.ImportDataWorkbookView" 
      ratio="0.5" 
      relationship="right" 
      relative="org.eclipse.ui.views.TaskList"> 
    </view> 
    </perspectiveExtension> 
    <perspectiveExtension 
     targetID="org.eclipse.ui.resourcePerspective"> 
    <view 
      id="project.views.ImportDataView" 
      ratio="0.5" 
      relationship="right" 
      relative="org.eclipse.ui.views.TaskList"> 
    </view> 
    </perspectiveExtension> 
    <perspectiveExtension 
     targetID="org.eclipse.ui.resourcePerspective"> 
    <view 
      id="project.views.DataView" 
      ratio="0.5" 
      relationship="right" 
      relative="org.eclipse.ui.views.TaskList"> 
    </view> 
    </perspectiveExtension> 
    <perspectiveExtension 
     targetID="org.eclipse.ui.resourcePerspective"> 
    <view 
      id="project.views.DataChangeView" 
      ratio="0.5" 
      relationship="right" 
      relative="org.eclipse.ui.views.TaskList"> 
    </view> 
    </perspectiveExtension> 
</extension> 
<extension 
    id="product" 
    point="org.eclipse.core.runtime.products"> 
    <product 
     application="PROJECT.application" 
     name="PROJECT: DESCRIPTION"> 
    <property 
      name="windowImages" 
      value="icons/CERView.gif,icons/CERView_32.gif,icons/CERView_48.gif"> 
    </property> 
    <property 
      name="aboutText" 
      value="PROJECT: DESCRIPTION"> 
    </property> 
    <property 
      name="aboutImage" 
      value="product_lg.gif"> 
    </property> 
    <property 
      name="appName" 
      value="PROJECT: DESCRIPTION"> 
    </property> 
    </product> 
</extension> 
<extension 
    point="org.eclipse.ui.intro"> 
    <intro 
     class="org.eclipse.ui.intro.config.CustomizableIntroPart" 
     icon="icons/project.png" 
     id="com.company.PROJECT.intro"> 
    </intro> 
    <introProductBinding 
     introId="com.company.PROJECT.intro" 
     productId="PROJECT.product"> 
    </introProductBinding> 
</extension> 
<extension 
    point="org.eclipse.ui.intro.config"> 
    <config 
     content="introContent.xml" 
     id="PROJECT.introConfigId" 
     introId="com.company.PROJECT.intro"> 
    <presentation 
      home-page-id="root"> 
     <implementation 
       kind="html" 
       os="win32,linux,macosx" 
       style="content/shared.css"> 
     </implementation> 
    </presentation> 
    </config> 
</extension> 
<extension 
    point="org.eclipse.ui.importWizards"> 
    <category 
     id="com.company.project.client.gui.wizards.sampleCategory" 
     name="Sample File Import"> 
    </category> 
    <wizard 
     category="com.company.project.client.gui.wizards.sampleCategory" 
     class="com.company.project.client.gui.wizards.ImportWizard" 
     icon="icons/sample.gif" 
     id="com.company.project.client.gui.wizards.ImportWizard" 
     name="Import Wizard"> 
    <description> 
    </description> 
    </wizard> 
    <wizard 
     category="com.company.project.client.gui.wizards.sampleCategory" 
     class="com.company.project.client.gui.wizards.TagDataWizard" 
     icon="icons/sample.gif" 
     id="com.company.project.client.gui.wizards.TagDataWizard" 
     name="Tag Data"> 
    <description> 
    </description> 
    </wizard> 
    <wizard 
     class="com.company.project.client.gui.wizards.EditColumnWizard" 
     icon="icons/editColumn.png" 
     id="com.company.project.client.gui.wizards.EditColumnWizard" 
     name="Edit Column Wizard"> 
    </wizard> 
</extension> 
<extension 
    point="org.eclipse.e4.ui.css.swt.theme"> 
    <theme 
     basestylesheeturi="content/e4_default.css" 
     id="org.eclipse.e4.ui.css.theme.e4_default.noos" 
     label="Default theme"> 
     </theme> 
    <theme 
     basestylesheeturi="content/e4_classic_winxp.css" 
     id="org.eclipse.e4.ui.css.theme.e4_classic" 
     label="Classic"> 
    </theme> 
    </extension> 

</plugin> 
+0

告訴我們你在plugin.xml中有什麼 –

+0

這很大,你想怎麼看?就像編輯一樣? – tmurphy

+0

只需編輯您的問題並添加plugin.xml –

回答

0

所以,我是啞巴,並沒有-clearPersistedState的。產品(啓動選項卡),這是因爲此,CSS沒有更新。你懂得越多。