首页 文章

Eclipse RCP 3.X到4 - 经典CSS

提问于
浏览
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 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>

1 回答

  • 0

    所以我很笨,在.product(启动标签)中没有-clearPersistedState,因此,css没有更新 . 你知道的越多 .

相关问题