| 135 | } |
| 136 | |
| 137 | IWorkbenchPart::Pointer ViewReference::CreatePart() |
| 138 | { |
| 139 | |
| 140 | // Check the status of this part |
| 141 | |
| 142 | IWorkbenchPart::Pointer result; |
| 143 | PartInitException* exception = nullptr; |
| 144 | |
| 145 | // Try to restore the view -- this does the real work of restoring the |
| 146 | // view |
| 147 | // |
| 148 | try |
| 149 | { |
| 150 | result = this->CreatePartHelper(); |
| 151 | } |
| 152 | catch (const PartInitException& e) |
| 153 | { |
| 154 | exception = e.clone(); |
| 155 | } |
| 156 | |
| 157 | // If unable to create the part, create an error part instead |
| 158 | // and pass the error to the status handling facility |
| 159 | if (exception != nullptr) |
| 160 | { |
| 161 | // IStatus partStatus = exception.getStatus(); |
| 162 | // IStatus displayStatus = StatusUtil.newStatus(partStatus, |
| 163 | // NLS.bind(WorkbenchMessages.ViewFactory_initException, partStatus.getMessage())); |
| 164 | // IStatus logStatus = StatusUtil |
| 165 | // .newStatus( |
| 166 | // partStatus, |
| 167 | // NLS |
| 168 | // .bind( |
| 169 | // "Unable to create view ID {0}: {1}", getId(), partStatus.getMessage())); //$NON-NLS-1$ |
| 170 | |
| 171 | // Pass the error to the status handling facility |
| 172 | // StatusManager.getManager().handle(logStatus); |
| 173 | |
| 174 | QString errorTitle = "Unable to create view ID " + this->GetId(); |
| 175 | WorkbenchPlugin::Log(errorTitle + ": " + exception->what()); |
| 176 | |
| 177 | IViewDescriptor::Pointer desc = factory->GetViewRegistry()->Find( |
| 178 | this->GetId()); |
| 179 | QString label = this->GetId(); |
| 180 | if (!desc.IsNull()) |
| 181 | { |
| 182 | label = desc->GetLabel(); |
| 183 | } |
| 184 | |
| 185 | QString errorMsg(exception->what()); |
| 186 | delete exception; |
| 187 | |
| 188 | errorMsg |
| 189 | += "<ul><li>Check your shared library for unresolved symbols</li>" |
| 190 | "<li>Check your class attribute in your plugin.xml file</li>" |
| 191 | "<li>Check your manifest.cpp file</li></ul>"; |
| 192 | ErrorViewPart::Pointer part(new ErrorViewPart(errorTitle, errorMsg)); |
| 193 | |
| 194 | //PartPane pane = getPane(); |
nothing calls this directly
no test coverage detected